Blob Blame History Raw
#include "toksvc_driver_impl.h"
#include "argv/argv.h"

const struct argv_option toks_default_options[] = {
	{"version",		'v',TAG_VERSION,ARGV_OPTARG_NONE,0,0,0,
				"show version information"},

	{"help",		'h',TAG_HELP,ARGV_OPTARG_OPTIONAL,0,"short|long",0,
				"show usage information [listing %s options only]"},

	{"sysroot",		0,TAG_SYSROOT,ARGV_OPTARG_REQUIRED,0,0,"<dir>",
				"pass a handle to %s to the spawned child process, "
				"and set it to be the child's intial root directory."},

	{"daemon",		0,TAG_DAEMON,ARGV_OPTARG_OPTIONAL,0,"default|always|never",0,
				"have the service's daemon thread handle signals sent by the "
				"application's own controlling terminal. The default is for "
				"the daemon thread to handle signals when the service runs as "
				"a stand-alone program, and defer the task to the main utility "
				"in all other cases."},

	{"uuid",		'u',TAG_UUID,ARGV_OPTARG_REQUIRED,0,0,"<uuid>",
				"set the service identifier to %s, which needs "
				"to be in the format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}."},

	{"refstr",		'f',TAG_REFSTR,ARGV_OPTARG_REQUIRED,0,0,"<refstr>",
				"include the reference string %s in log records"
				"that pertain to this client."},

	{"tokens",		't',TAG_TOKENS,ARGV_OPTARG_REQUIRED,0,0,"<ntokens>",
				"set the number of available tokens to %s, which should be "
				"in the range of 1..9999."},

	{"connect",		'c',TAG_CONNECT,ARGV_OPTARG_NONE,0,0,0,
				"connect to the server without placing any request"},

	{"abort",		'k',TAG_ABORT,ARGV_OPTARG_NONE,0,0,0,
				"ask the token service to terminate"},

	{"acquire",		'a',TAG_ACQUIRE,ARGV_OPTARG_NONE,0,0,0,
				"acquire the next available token"},

	{"pid",			'p',TAG_PID,ARGV_OPTARG_REQUIRED,0,0,"<pid>",
				"assign the token to the framework process "
				"identified by %s"},

	{"syspid",		'P',TAG_SYSPID,ARGV_OPTARG_REQUIRED,0,0,"<syspid>",
				"assign the token to the system process "
				"identified by %s"},

	{"release",		'r',TAG_RELEASE,ARGV_OPTARG_REQUIRED,0,0,"<token>",
				"release the key specified by %s."},

	{"timeout",		'm',TAG_TIMEOUT,ARGV_OPTARG_REQUIRED,0,0,"<millisecs>",
				"set the acquire operation's timeout to %s milliseconds; "
				"a timeout of zero milliseconds implies no wait at all; "
				"not setting a timeout implies an indefinite wait."},

	{"ctrl-pid",		'l',TAG_CTRLPID,ARGV_OPTARG_REQUIRED,0,0,"<pid>",
				"set the service's controlling process to the "
				"framework process identified by %s"},

	{"ctrl-syspid",		'L',TAG_CSYSPID,ARGV_OPTARG_REQUIRED,0,0,"<syspid>",
				"set the service's controlling process to the "
				"system process identified by %s"},

	{"log-file",		'o',TAG_LOGFILE,ARGV_OPTARG_REQUIRED,0,0,"<logfile>",
				"set the log file to %s, which may be in root-relative "
				"format (/path/to/log, native shell format "
				"(x:/path/to/log), or native driver format "
				"(e.g. \\Device\\HarddiskX\\path\\to\\log"},

	{"log-level",		'O',TAG_LOGLEVEL,ARGV_OPTARG_REQUIRED,0,0,"<loglevel>",
				"set the log level to %s in the range of 0..9"},

	{0,0,0,0,0,0,0,0}
};