2 Unix SMB/CIFS implementation.
5 Copyright (C) Tim Potter 2001,2002
6 Copyright (C) Jelmer Vernooij 2002
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /* Handle command line options:
31 extern pstring user_socket_options;
32 extern BOOL AllowDebugChange;
33 extern pstring global_myname;
35 static void popt_common_callback(poptContext con,
36 enum poptCallbackReason reason,
37 const struct poptOption *opt,
38 const char *arg, const void *data)
43 debug_parse_levels(arg);
44 AllowDebugChange = False;
49 printf( "Version %s\n", VERSION );
54 pstrcpy(user_socket_options,arg);
58 pstrcpy(dyn_CONFIGFILE, arg);
62 pstrcpy(global_myname,arg);
63 strupper(global_myname);
68 struct poptOption popt_common_debug[] = {
69 { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
70 { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level",
75 struct poptOption popt_common_configfile[] = {
76 { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
77 { "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternative configuration file" },
81 struct poptOption popt_common_socket_options[] = {
82 { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
83 {"socket-options", 'O', POPT_ARG_STRING, NULL, 'O', "socket options to use" },
87 struct poptOption popt_common_version[] = {
88 { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
89 {"version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
93 struct poptOption popt_common_netbios_name[] = {
94 { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
95 {"netbiosname", 'n', POPT_ARG_STRING, NULL, 'n', "Primary netbios name"},