diff options
Diffstat (limited to 'convert-dtsv0-lexer.l')
-rw-r--r-- | convert-dtsv0-lexer.l | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/convert-dtsv0-lexer.l b/convert-dtsv0-lexer.l index 89d540a..e62d27a 100644 --- a/convert-dtsv0-lexer.l +++ b/convert-dtsv0-lexer.l @@ -194,11 +194,15 @@ const struct { } %% -static void usage(void) -{ - fprintf(stderr, "convert-dtsv0 <v0 dts file>...\n"); - exit(3); -} +/* Usage related data. */ +static const char usage_synopsis[] = "convert-dtsv0 [options] <v0 dts file>..."; +static const char usage_short_opts[] = "" USAGE_COMMON_SHORT_OPTS; +static struct option const usage_long_opts[] = { + USAGE_COMMON_LONG_OPTS +}; +static const char * const usage_opts_help[] = { + USAGE_COMMON_OPTS_HELP +}; static void convert_file(const char *fname) { @@ -226,10 +230,16 @@ static void convert_file(const char *fname) int main(int argc, char *argv[]) { + int opt; int i; + while ((opt = util_getopt_long()) != EOF) { + switch (opt) { + case_USAGE_COMMON_FLAGS + } + } if (argc < 2) - usage(); + long_usage("missing filename"); for (i = 1; i < argc; i++) { fprintf(stderr, "Converting %s from dts v0 to dts v1\n", argv[i]); |