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}."},

	{"root-uuid",		'U',TAG_ROOTUUID,ARGV_OPTARG_NONE,0,0,0,
				"set the service identifier to a uuid based on "
				"unique properties of the sysroot directory"},

	{"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"},

	{"get-token-pool-size",	'n',TAG_NTOKENSGET,ARGV_OPTARG_NONE,0,0,0,
				"connect to the server and output the current overall "
				"number of tokens"},

	{"set-token-pool-size",	'N',TAG_NTOKENSSET,ARGV_OPTARG_REQUIRED,0,0,"<ntokens>",
				"connect to the server and set the service's overall "
				"number of tokens to %s"},

	{"get-service-info",	'i',TAG_GETSVCINFO,ARGV_OPTARG_NONE,0,0,0,
				"connect to the server and output the current service "
				"information"},

	{"log-service-info",	'I',TAG_LOGSVCINFO,ARGV_OPTARG_NONE,0,0,0,
				"connect to the server and request that the current "
				"service information be sent to its log"},

	{"get-token-info",	's',TAG_GETTOKINFO,ARGV_OPTARG_NONE,0,0,0,
				"connect to the server and output the current "
				"service information, along with information about all "
				"currently allocated tokens"},

	{"log-token-info",	'S',TAG_LOGTOKINFO,ARGV_OPTARG_NONE,0,0,0,
				"connect to the server and request that the current "
				"service information, along with information about all "
				"currently allocated tokens, be sent to the log"},

	{"get-log-level",	'g',TAG_LOGLEVELGET,ARGV_OPTARG_NONE,0,0,0,
				"connect to the server and output the service's "
				"current log level"},

	{"set-log-level",	'G',TAG_LOGLEVELSET,ARGV_OPTARG_REQUIRED,0,0,"<loglevel>",
				"connect to the server and request that the service's "
				"log-level be set to %s in the range of 0..9"},


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