some double options and broke some parameters.
{ "send-buffer", 'b', POPT_ARG_INT, NULL, 'b', "Changes the transmit/send buffer", "BYTES" },
{ "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" },
POPT_COMMON_SAMBA
- POPT_CREDENTIALS
+ POPT_COMMON_CONNECTION
+ POPT_COMMON_CREDENTIALS
POPT_TABLEEND
};
/* Common popt structures */
extern struct poptOption popt_common_samba[];
+extern struct poptOption popt_common_connection[];
+extern struct poptOption popt_common_version[];
extern struct poptOption popt_common_credentials[];
#ifndef POPT_TABLEEND
#endif
#define POPT_COMMON_SAMBA { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_samba, 0, "Common samba options:", NULL },
-#define POPT_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL },
+#define POPT_COMMON_CONNECTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_connection, 0, "Connection options:", NULL },
+#define POPT_COMMON_VERSION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version, 0, "Common samba options:", NULL },
+#define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL },
struct user_auth_info {
pstring username;
}
}
-struct poptOption popt_common_samba[] = {
+struct poptOption popt_common_connection[] = {
{ NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
- { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
- { "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternative configuration file",
- "CONFIGFILE" },
{ "socket-options", 'O', POPT_ARG_STRING, NULL, 'O', "socket options to use",
"SOCKETOPTIONS" },
- { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
- { "log-basename", 'l', POPT_ARG_STRING, NULL, 'l', "Basename for log/debug files",
- "LOGFILEBASE" },
{ "netbiosname", 'n', POPT_ARG_STRING, NULL, 'n', "Primary netbios name", "NETBIOSNAME" },
{ "workgroup", 'W', POPT_ARG_STRING, NULL, 'W', "Set the workgroup name", "WORKGROUP" },
{ "scope", 'i', POPT_ARG_STRING, NULL, 'i', "Use this Netbios scope", "SCOPE" },
POPT_TABLEEND
};
+struct poptOption popt_common_samba[] = {
+ { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
+ { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
+ { "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternative configuration file", "CONFIGFILE" },
+ { "log-basename", 'l', POPT_ARG_STRING, NULL, 'l', "Basename for log/debug files", "LOGFILEBASE" },
+ { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
+ POPT_TABLEEND
+};
+
+struct poptOption popt_common_version[] = {
+ { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
+ { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
+ POPT_TABLEEND
+};
+
+
+
/****************************************************************************
* get a password from a a file or file descriptor
* exit on failure
{"hosts", 'H', POPT_ARG_STRING, dyn_LMHOSTSFILE, 'H', "Load a netbios hosts file"},
{"port", 'p', POPT_ARG_INT, &global_nmb_port, NMB_PORT, "Listen on the specified port" },
POPT_COMMON_SAMBA
+ POPT_COMMON_CONNECTION
{ NULL }
};
pstring logfile;
{ "set-auth-user", 'A', POPT_ARG_STRING, &string_arg, OPT_SET_AUTH_USER, "Store user and password used by winbindd (root only)", "user%password" },
{ "get-auth-user", 0, POPT_ARG_NONE, NULL, OPT_GET_AUTH_USER, "Retrieve user and password used by winbindd (root only)", NULL },
{ "ping", 'p', POPT_ARG_NONE, 0, 'p', "Ping winbindd to see if it is alive" },
- POPT_COMMON_SAMBA
+ POPT_COMMON_VERSION
POPT_TABLEEND
};
{ "dual-daemon", 'B', POPT_ARG_VAL, &opt_dual_daemon, True, "Dual daemon mode" },
{ "no-caching", 'n', POPT_ARG_VAL, &opt_nocache, False, "Disable caching" },
POPT_COMMON_SAMBA
+ POPT_COMMON_CONNECTION
POPT_TABLEEND
};
poptContext pc;
{"command", 'c', POPT_ARG_STRING, &cmdstr, 'c', "Execute semicolon separated cmds", "COMMANDS"},
{"dest-ip", 'I', POPT_ARG_STRING, &opt_ipaddr, 'I', "Specify destination IP address", "IP"},
POPT_COMMON_SAMBA
- POPT_CREDENTIALS
+ POPT_COMMON_CONNECTION
+ POPT_COMMON_CREDENTIALS
POPT_TABLEEND
};
{"build-options", 'b', POPT_ARG_NONE, NULL, 'b', "Print build options" },
{"port", 'p', POPT_ARG_STRING, &ports, 0, "Listen on the specified ports"},
POPT_COMMON_SAMBA
+ POPT_COMMON_CONNECTION
{ NULL }
};
{"force", 'f', POPT_ARG_NONE, &opt_force},
{"timeout", 't', POPT_ARG_INT, &opt_timeout},
{"machine-pass",'P', POPT_ARG_NONE, &opt_machine_pass},
+ {"myworkgroup", 'W', POPT_ARG_STRING, &opt_workgroup},
POPT_COMMON_SAMBA
{ 0, 0, 0, 0}
};
{ "root-port", 'r', POPT_ARG_VAL, &RootPort, True, "Use root port 137 (Win95 only replies to this)" },
{ "lookup-by-ip", 'A', POPT_ARG_VAL, &lookup_by_ip, True, "Do a node status on <name> as an IP Address" },
POPT_COMMON_SAMBA
+ POPT_COMMON_CONNECTION
{ 0, 0, 0, 0 }
};
{ "request-lm-key", 0, POPT_ARG_NONE, &request_lm_key, OPT_LM_KEY, "Retreive LM session key"},
{ "request-nt-key", 0, POPT_ARG_NONE, &request_nt_key, OPT_NT_KEY, "Retreive NT session key"},
POPT_COMMON_SAMBA
- POPT_CREDENTIALS
+ POPT_COMMON_CONNECTION
+ POPT_COMMON_CREDENTIALS
POPT_TABLEEND
};
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
- {"list", 'l', POPT_ARG_NONE, &list_users, 0, "list all users", NULL},
+ {"list", 'L', POPT_ARG_NONE, &list_users, 0, "list all users", NULL},
{"verbose", 'v', POPT_ARG_NONE, &verbose, 0, "be verbose", NULL },
{"smbpasswd-style", 'w',POPT_ARG_NONE, &spstyle, 0, "give output in smbpasswd style", NULL},
{"user", 'u', POPT_ARG_STRING, &user_name, 0, "use username", "USER" },
{ "numeric", 0, POPT_ARG_NONE, &numeric, True, "Don't resolve sids or masks to names" },
{ "test-args", 't', POPT_ARG_NONE, &test_args, True, "Test arguments"},
POPT_COMMON_SAMBA
- POPT_CREDENTIALS
+ POPT_COMMON_CREDENTIALS
{ NULL }
};
{ "domains", 'D', POPT_ARG_VAL, &level, LEV_WORKGROUP, "List only domains (workgroups) of tree" },
{ "servers", 'S', POPT_ARG_VAL, &level, LEV_SERVER, "List domains(workgroups) and servers of tree" },
POPT_COMMON_SAMBA
- POPT_CREDENTIALS
+ POPT_COMMON_CREDENTIALS
POPT_TABLEEND
};
poptContext pc;
{"verbose", 'v', POPT_ARG_NONE, &show_defaults, 1, "Show default options too"},
{"server", 'L',POPT_ARG_STRING, &new_local_machine, 0, "Set %%L macro to servername\n"},
{"encoding", 't', POPT_ARG_STRING, &term_code, 0, "Print parameters with encoding"},
- POPT_COMMON_SAMBA
- {0,0,0,0}
+ POPT_COMMON_VERSION
+ POPT_TABLEEND
};
pc = poptGetContext(NULL, argc, argv, long_options,
{ "interactive", 'i', POPT_ARG_NONE, NULL, 'i', "Run interactive (not a daemon)" },
{ "port", 'p', POPT_ARG_INT, &wins_port, 'p', "Listen on the specified port" },
POPT_COMMON_SAMBA
+ POPT_COMMON_CONNECTION
POPT_TABLEEND
};
int opt;