From 12e0c937a462eca9e25b99a5e53d0c7842a87f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano?= Date: Tue, 1 Jan 2013 21:09:00 +0100 Subject: [PATCH] long options --- opustags.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/opustags.c b/opustags.c index b2a9707..78b5923 100644 --- a/opustags.c +++ b/opustags.c @@ -155,6 +155,16 @@ int write_page(ogg_page *og, FILE *stream){ return 0; } +struct option options[] = { + {"output", required_argument, 0, 'o'}, + {"overwrite", no_argument, 0, 'y'}, + {"delete", required_argument, 0, 'd'}, + {"add", required_argument, 0, 'a'}, + {"set", required_argument, 0, 's'}, + {"delete-all", required_argument, 0, 'D'}, + {"set-all", required_argument, 0, 'S'} +}; + int main(int argc, char **argv){ const char *path_in, *path_out = NULL; const char* to_add[argc]; @@ -164,7 +174,7 @@ int main(int argc, char **argv){ int set_all = 0; int overwrite = 0; int c; - while((c = getopt(argc, argv, "o:yd:a:s:DS")) != -1){ + while((c = getopt_long(argc, argv, "o:yd:a:s:DS", options, NULL)) != -1){ switch(c){ case 'o': path_out = optarg;