diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-13 00:28:23 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-13 00:28:23 +0000 |
commit | 40c229c8bd507b8ad25125e75c5d477800273068 (patch) | |
tree | 0099758312186731c20a74437a2a888dfc8bb6d2 /apps/drwho/Options.cpp | |
parent | b83d24d85a208c4ee539b428d3fc5e361bc2aeca (diff) | |
download | ATCD-40c229c8bd507b8ad25125e75c5d477800273068.tar.gz |
*** empty log message ***
Diffstat (limited to 'apps/drwho/Options.cpp')
-rw-r--r-- | apps/drwho/Options.cpp | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/apps/drwho/Options.cpp b/apps/drwho/Options.cpp index bb102b3f6b1..aff066c72ad 100644 --- a/apps/drwho/Options.cpp +++ b/apps/drwho/Options.cpp @@ -1,63 +1,64 @@ // $Id$ + #include "global.h" -#include "new.h" #include "Multicast_Manager.h" #include "ace/Get_Opt.h" #include "Options.h" -/* Initialize all the static variables. */ +// Initialize all the static variables. -/* Contains bit-mask for options. */ -unsigned int Options::option_word = 0; +// Contains bit-mask for options. +u_int Options::option_word = 0; -/* Which protocol are we using? */ +// Which protocol are we using? Options::Protocol_Types Options::protocol_type = Options::PROTO_FLO; -/* User name for quick lookups. */ +// User name for quick lookups. char *Options::user_name = 0; -/* Port number for client/server. */ +// Port number for client/server. short Options::port_number = PORT_NUMBER; -/* Maximum time the client waits for servers to timeout. */ +// Maximum time the client waits for servers to timeout. int Options::max_server_timeout = 5; -/* Name of the program. */ +// Name of the program. char *Options::program_name; -/* Default name of file that stores friend info. */ +// Default name of file that stores friend info. char *Options::friend_file = FRIEND_FILE; void Options::print_usage_and_die (int long_msg) { - fprintf (stderr, "usage: %s %s", program_name, - long_msg - ? "\n" - "-?\tprints a short usage message\n" - "-A\tappend the following hostname to the list of predefined hostnames.\n" - "-a\treturn information on *all* users remotely logged in (uses yp passwd).\n" - "-b\trun the server in the background (i.e., as a daemon).\n" - "-d\tturn on debugging.\n" - "-F\tuse the following file contents to initialize the host list.\n" - "-f\tuse the following file contents to initialize the friends database.\n" - "-H\tuse the following hostname as part of the new list of hostnames.\n" - "\t(this option overwrites the existing default names).\n" - "-h\tprint a long usage message.\n" - "-L\tprint the login name rather than the real name (which is the default).\n" - "-l\tprint information in long format (works for all protocols).\n" - "-p\tset the port number (server must correspond).\n" - "-r\tdo the remote lookups (i.e., local operations are the default).\n" - "-R\tprint info using the rusers format.\n" - "-s\tsort the output by login name.\n" - "-S\tsort the output by real name.\n" - "-t\tset the amount of time we wait for servers to timeout.\n" - "-w\treturn information on just one user.\n" - : "[-?haAbdfFHhLlpRrtw]\n"); - exit (1); + ACE_DEBUG ((LM_DEBUG, + "usage: %s %s", + program_name, + long_msg + ? "\n" + "-?\tprints a short usage message\n" + "-A\tappend the following hostname to the list of predefined hostnames.\n" + "-a\treturn information on *all* users remotely logged in (uses yp passwd).\n" + "-b\trun the server in the background (i.e., as a daemon).\n" + "-d\tturn on debugging.\n" + "-F\tuse the following file contents to initialize the host list.\n" + "-f\tuse the following file contents to initialize the friends database.\n" + "-H\tuse the following hostname as part of the new list of hostnames.\n" + "\t(this option overwrites the existing default names).\n" + "-h\tprint a long usage message.\n" + "-L\tprint the login name rather than the real name (which is the default).\n" + "-l\tprint information in long format (works for all protocols).\n" + "-p\tset the port number (server must correspond).\n" + "-r\tdo the remote lookups (i.e., local operations are the default).\n" + "-R\tprint info using the rusers format.\n" + "-s\tsort the output by login name.\n" + "-S\tsort the output by real name.\n" + "-t\tset the amount of time we wait for servers to timeout.\n" + "-w\treturn information on just one user.\n" + : "[-?haAbdfFHhLlpRrtw]\n")); + ACE_OS::exit (1); } -#ifndef __OPTIMIZE__ void Options::set_opt (Option_Types opt) { @@ -69,7 +70,6 @@ Options::get_opt (Option_Types opt) { return (Options::option_word & opt) != 0; } -#endif /* __OPTIMIZE__ */ void Options::set_options (int argc, char *argv[]) @@ -104,7 +104,10 @@ Options::set_options (int argc, char *argv[]) break; case 'F': if (Multicast_Manager::insert_hosts_from_file (getopt.optarg) < 0) - perror (Options::program_name), exit (1); + ACE_DEBUG ((LM_DEBUG, + "%p%a\n", + Options::program_name, + 1)); add_default_hosts = 0; break; case 'H': @@ -139,7 +142,7 @@ Options::set_options (int argc, char *argv[]) Options::max_server_timeout = atoi (getopt.optarg); break; case 'w': - Options::user_name = getopt.optarg; + Options::user_name = getopt.optarg; Options::protocol_type = PROTO_USR; break; default: |