lib:cmdline: Rename to cmdline_sanity_checker
authorAndreas Schneider <asn@samba.org>
Mon, 3 May 2021 11:35:37 +0000 (13:35 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 6 May 2021 12:40:28 +0000 (12:40 +0000)
Will give nicer output if we find duplicates!

$ net help
cmdline_sanity_checker: Duplicate option --long|-l detected!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/cmdline/cmdline.c

index 7c65ed28365610649a3f05936a2e6e4063419b3a..592db97cabb4b76f21e3cf0936d5da3eb841c463 100644 (file)
@@ -212,7 +212,7 @@ static void find_duplicates(const struct poptOption *needle,
        }
 }
 
-static bool opt_sanity_check(const struct poptOption *current_opts,
+static bool cmdline_sanity_checker(const struct poptOption *current_opts,
                             const struct poptOption *full_opts)
 {
        const struct poptOption *o = current_opts;
@@ -225,7 +225,7 @@ static bool opt_sanity_check(const struct poptOption *current_opts,
                switch (o->argInfo) {
                case POPT_ARG_INCLUDE_TABLE:
                        if (o->arg != NULL) {
-                               ok = opt_sanity_check(o->arg, full_opts);
+                               ok = cmdline_sanity_checker(o->arg, full_opts);
                                if (!ok) {
                                        return false;
                                }
@@ -257,7 +257,7 @@ static bool opt_sanity_check(const struct poptOption *current_opts,
 
 bool samba_cmdline_sanity_check(const struct poptOption *opts)
 {
-       return opt_sanity_check(opts, opts);
+       return cmdline_sanity_checker(opts, opts);
 }
 
 poptContext samba_popt_get_context(const char * name,