From 7f58dc9d700a10d8f7a4313c7db41b411a11f9e4 Mon Sep 17 00:00:00 2001 From: Estelle Poulin Date: Tue, 14 Jan 2020 11:08:58 -0500 Subject: [PATCH] Add options support --- main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.c b/main.c index c34a185..46deb75 100644 --- a/main.c +++ b/main.c @@ -3,6 +3,7 @@ int main(int argc, char *argv[]) { int opt; + printf("Options:"); while ((opt = getopt(argc, argv, "-1246ab:c:e:fgi:kl:m:no:p:qstvx" "AB:CD:E:F:GI:J:KL:MNO:PQ:R:S:TVw:W:XYy")) != -1) { // Stop processing options after the first positional argument and set @@ -11,7 +12,13 @@ main(int argc, char *argv[]) { optind -= 1; break; } + + printf(" -%c", opt); + if (optarg != 0) { + printf(" %s", optarg); + } } + printf("\n"); if (optind >= argc) { fprintf(stderr, "No destination found.\n");