[server/tests PATCH 3/6] server/tests: invalid-option: print the bad argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



optind points to the next argument to parse.
---
 server/tests/test_display_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index cf3990f..a4fdae9 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -892,7 +892,7 @@ void spice_test_config_parse_args(int argc, char **argv)
     while ((val = getopt_long(argc, argv, "", options, &option_index)) != -1) {
         switch (val) {
         case '?':
-            printf("unrecognized option %s", argv[optind]);
+            printf("unrecognized option '%s'\n", argv[optind - 1]);
             goto invalid_option;
         case 0:
             break;
-- 
1.7.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]