diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-08-26 13:21:30 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-08-26 13:21:30 +0200 |
commit | e73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2 (patch) | |
tree | e953538a8ff426089f2955918824509d558fe84f /src/test.c | |
parent | issue 2, info manual (diff) | |
download | argparser-e73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2.tar.gz argparser-e73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2.tar.bz2 argparser-e73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2.tar.xz |
update test
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/test.c')
-rw-r--r-- | src/test.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -48,6 +48,7 @@ int main(int argc, char** argv) args_add_option(args_new_argumentless(NULL, 0, "++hidden", NULL), 0); args_add_option(args_new_argumented(NULL, "LINE", 0, "-l", "--line", NULL), "Prints the choosen line"); + args_add_option(args_new_optargumented(NULL, NULL, "LINE", 0, "-L", "--Line", NULL), "Prints the choosen line"); args_add_option(args_new_variadic(NULL, "LINE", 0, "--l", "--lines", NULL), "Prints the choosen lines"); args_parse(argc, argv); @@ -70,6 +71,13 @@ int main(int argc, char** argv) for (n = args_opts_get_count("--line"); i < n; i++) printf("%s\n", *(arr + i)); } + if (args_opts_used("-L")) + { + i = 0; + arr = args_opts_get("--Line"); + for (n = args_opts_get_count("--Line"); i < n; i++) + printf("%s\n", *(arr + i)); + } if (args_opts_used("--lines")) { i = 0; |