Signed-off-by: David Sterba <dsterba@suse.cz>
{ "mbytes", no_argument, NULL, 'm'},
{ "gbytes", no_argument, NULL, 'g'},
{ "tbytes", no_argument, NULL, 't'},
{ "mbytes", no_argument, NULL, 'm'},
{ "gbytes", no_argument, NULL, 'g'},
{ "tbytes", no_argument, NULL, 't'},
- { "si", no_argument, NULL, 256},
- { "iec", no_argument, NULL, 257},
+ { "si", no_argument, NULL, GETOPT_VAL_SI},
+ { "iec", no_argument, NULL, GETOPT_VAL_IEC},
};
int c = getopt_long(argc, argv, "bhHkmgtT", long_options,
&long_index);
};
int c = getopt_long(argc, argv, "bhHkmgtT", long_options,
&long_index);
case 'H':
unit_mode = UNITS_HUMAN_DECIMAL;
break;
case 'H':
unit_mode = UNITS_HUMAN_DECIMAL;
break;
units_set_mode(&unit_mode, UNITS_DECIMAL);
break;
units_set_mode(&unit_mode, UNITS_DECIMAL);
break;
units_set_mode(&unit_mode, UNITS_BINARY);
break;
case 'T':
units_set_mode(&unit_mode, UNITS_BINARY);
break;
case 'T':
{ "mbytes", no_argument, NULL, 'm'},
{ "gbytes", no_argument, NULL, 'g'},
{ "tbytes", no_argument, NULL, 't'},
{ "mbytes", no_argument, NULL, 'm'},
{ "gbytes", no_argument, NULL, 'g'},
{ "tbytes", no_argument, NULL, 't'},
- { "si", no_argument, NULL, 256},
- { "iec", no_argument, NULL, 257},
+ { "si", no_argument, NULL, GETOPT_VAL_SI},
+ { "iec", no_argument, NULL, GETOPT_VAL_IEC},
};
int c = getopt_long(argc, argv, "bhHkmgt", long_options,
&long_index);
};
int c = getopt_long(argc, argv, "bhHkmgt", long_options,
&long_index);
case 'H':
unit_mode = UNITS_HUMAN_DECIMAL;
break;
case 'H':
unit_mode = UNITS_HUMAN_DECIMAL;
break;
units_set_mode(&unit_mode, UNITS_DECIMAL);
break;
units_set_mode(&unit_mode, UNITS_DECIMAL);
break;
units_set_mode(&unit_mode, UNITS_BINARY);
break;
default:
units_set_mode(&unit_mode, UNITS_BINARY);
break;
default:
#define ARGV0_BUF_SIZE PATH_MAX
#define ARGV0_BUF_SIZE PATH_MAX
+#define GETOPT_VAL_SI 256
+#define GETOPT_VAL_IEC 257
+
int check_argc_exact(int nargs, int expected);
int check_argc_min(int nargs, int expected);
int check_argc_max(int nargs, int expected);
int check_argc_exact(int nargs, int expected);
int check_argc_min(int nargs, int expected);
int check_argc_max(int nargs, int expected);