cli: 'dev list' adjustments

Modifications are mainly for multiline mode to ease parsing - each
field name is prefixed with a section name.
'dev list' now also supports printing particular sections specifed via
'--fields' option.
This commit is contained in:
Jiří Klimeš
2010-03-24 19:05:35 +01:00
parent 31970798bc
commit a91da03b65
5 changed files with 314 additions and 246 deletions

View File

@@ -66,12 +66,14 @@ typedef struct {
} NmcOutputField;
/* Flags for NmcPrintFields */
#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular*/
#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse outpud mode */
#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */
#define NMC_PF_FLAG_MAIN_HEADER 0x00000008 /* Print main header */
#define NMC_PF_FLAG_FIELD_NAMES 0x00000010 /* Print field names instead of values */
#define NMC_PF_FLAG_ESCAPE 0x00000020 /* Escape column separator and '\' */
#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular */
#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse output mode */
#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */
#define NMC_PF_FLAG_MAIN_HEADER_ADD 0x00000008 /* Print main header in addition to values/field names */
#define NMC_PF_FLAG_MAIN_HEADER_ONLY 0x00000010 /* Print main header only */
#define NMC_PF_FLAG_FIELD_NAMES 0x00000020 /* Print field names instead of values */
#define NMC_PF_FLAG_ESCAPE 0x00000040 /* Escape column separator and '\' */
#define NMC_PF_FLAG_SECTION_PREFIX 0x00000080 /* Use the first value as section prefix for the other field names - just in multiline */
typedef struct {
GArray *indices; /* Array of field indices to the array of allowed fields */