nsswitch: Migrate wbinfo to new cmdline option parser
authorAndreas Schneider <asn@samba.org>
Thu, 14 Jan 2021 09:53:35 +0000 (10:53 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 20 Jun 2021 23:26:32 +0000 (23:26 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
nsswitch/wbinfo.c
nsswitch/wscript_build

index c8006f85d6ece69ba35d2a89d7ddc326a02db837..1656f02f0e68e73afb331b625796ed7001480e6c 100644 (file)
@@ -25,7 +25,7 @@
 #include "winbind_client.h"
 #include "libwbclient/wbclient.h"
 #include "../libcli/auth/libcli_auth.h"
-#include "lib/cmdline/popt_common.h"
+#include "lib/cmdline/cmdline.h"
 #include "lib/afs/afs_settoken.h"
 #include "lib/util/smb_strtox.h"
 #include "lib/util/string_wrappers.h"
@@ -2812,8 +2812,15 @@ int main(int argc, const char **argv, char **envp)
 
        /* Parse options */
 
-       pc = poptGetContext("wbinfo", argc, argv,
-                           long_options, 0);
+       pc = samba_popt_get_context(getprogname(),
+                                   argc,
+                                   argv,
+                                   long_options,
+                                   0);
+       if (pc == NULL) {
+               DBG_ERR("Failed to setup popt context!\n");
+               exit(1);
+       }
 
        /* Parse command line options */
 
index e612377962c49f48510cca4c95f2f42781a222fb..afd7453670b4d0c550b2cdb5762e7fc044c1c57f 100644 (file)
@@ -143,5 +143,5 @@ bld.SAMBA_SUBSYSTEM('WB_REQTRANS',
 
 bld.SAMBA_BINARY('wbinfo',
        source='wbinfo.c',
-       deps='samba-util LIBCLI_AUTH popt POPT_SAMBA wbclient LIBAFS_SETTOKEN'
+       deps='samba-util LIBCLI_AUTH popt cmdline wbclient LIBAFS_SETTOKEN'
        )