* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Jan-Simon Pendry at Imperial College, London.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* @(#)get_args.c 5.3 (Berkeley) 5/12/91
* $Id: get_args.c,v 5.2.1.5 91/05/07 22:17:52 jsp Alpha $
#if defined(DEBUG) && defined(PARANOID)
#endif /* defined(DEBUG) && defined(PARANOID) */
int restart_existing_mounts
;
char *karch
; /* Kernel architecture */
char *cluster
; /* Cluster name */
char *domain
; /* YP domain */
#endif /* HAS_NIS_MAPS */
int am_timeo_w
= AM_TTL_W
;
static struct opt_tab dbg_opt
[] = {
{ "all", D_ALL
}, /* All */
{ "amq", D_AMQ
}, /* Register for AMQ program */
{ "daemon", D_DAEMON
}, /* Enter daemon mode */
{ "full", D_FULL
}, /* Program trace */
{ "mem", D_MEM
}, /* Trace memory allocations */
{ "mtab", D_MTAB
}, /* Use local mtab file */
{ "str", D_STR
}, /* Debug string munging */
{ "test", D_TEST
}, /* Full debug - but no daemon */
{ "trace", D_TRACE
}, /* Protocol trace */
int debug_flags
= D_AMQ
/* Register AMQ */
|D_DAEMON
/* Enter daemon mode */
* Switch on/off debug options
return cmdoption(opt
, dbg_opt
, &debug_flags
);
while ((opt_ch
= getopt(c
, v
, "mnprva:c:d:h:k:l:t:w:x:y:C:D:")) != EOF
)
fprintf(stderr
, "%s: -a option must begin with a '/'\n",
#if defined(HAS_HOST) && defined(HOST_EXEC)
plog(XLOG_USER
, "-h: option ignored. HOST_EXEC is not enabled.");
#endif /* defined(HAS_HOST) && defined(HOST_EXEC) */
plog(XLOG_USER
, "The -m option is no longer supported.");
plog(XLOG_USER
, "... Use `ypcat -k am.master` on the command line instead");
restart_existing_mounts
= 1;
{ char *dot
= strchr(optarg
, '.');
afs_timeo
= atoi(optarg
);
afs_retrans
= atoi(dot
+1);
fprintf(stderr
, "%s%s (%s-endian).\n", copyright
, version
, endian
);
fputs("Map support for: ", stderr
);
fputs(".\nFS: ", stderr
);
fprintf(stderr
, "Primary network is %s.\n", wire
);
am_timeo_w
= atoi(optarg
);
usage
+= switch_option(optarg
);
plog(XLOG_USER
, "-y: option ignored. No NIS support available.");
#endif /* HAS_NIS_MAPS */
usage
+= debug_option(optarg
);
fprintf(stderr
, "%s: not compiled with DEBUG option -- sorry.\n", progname
);
if (xlog_level_init
== ~0) {
(void) switch_option("");
usage
+= switch_option("debug");
usage
+= switch_option("debug");
if (v
[optind
] && *v
[optind
] == '-')
root_newmap(dir
, opts
, map
);
* HP-UX can't handle ./mtab
* That system is sick - really.
* Append domain name to hostname.
* sub_domain overrides hostdomain
strcat(hostd
, hostdomain
);
if (debug_flags
& D_MTAB
)
{ if (debug_flags
& D_MTAB
) {
dlog("-D mtab option ignored");
if (switch_to_logfile(logfile
) != 0)
plog(XLOG_USER
, "Cannot switch logfile");
* If the kernel architecture was not specified
* then use the machine architecture.
afs_retrans
= AFS_RETRANS
;
afs_retrans
= 3; /* XXX */
"Usage: %s [-mnprv] [-a mnt_point] [-c cache_time] [-d domain]\n\
\t[-k kernel_arch] [-l logfile|\"syslog\"] [-t afs_timeout]\n\
\t[-w wait_timeout] [-C cluster_name]", progname
);
#if defined(HAS_HOST) && defined(HOST_EXEC)
fputs(" [-h host_helper]\n", stderr
);
#endif /* defined(HAS_HOST) && defined(HOST_EXEC) */
fputs(" [-y nis-domain]\n", stderr
);
#endif /* HAS_NIS_MAPS */
show_opts('x', xlog_opt
);
fprintf(stderr
, "\t{directory mapname [-map_options]} ...\n");