- fprintf(stderr, "%s -s [-r host] [-l level] message...\n", myname);
- fprintf(stderr, " send a message\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "%s -s [-r host] -k key val [key val]...\n", myname);
- fprintf(stderr, " send a message with the given keys and values\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "%s -c process [filter]\n", myname);
- fprintf(stderr, " get (set if filter is specified) syslog filter for process (pid or name)\n");
- fprintf(stderr, " level may be any combination of the characters \"p a c e w n i d\"\n");
- fprintf(stderr, " p = Emergency (\"Panic\")\n");
- fprintf(stderr, " a = Alert\n");
- fprintf(stderr, " c = Critical\n");
- fprintf(stderr, " e = Error\n");
- fprintf(stderr, " w = Warning\n");
- fprintf(stderr, " n = Notice\n");
- fprintf(stderr, " i = Info\n");
- fprintf(stderr, " d = Debug\n");
- fprintf(stderr, " a minus sign preceeding a single letter means \"up to\" that level\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "%s [-f file...] [-d path...] [-x file] [-w [N]] [-F format] [-u] [-k key [[op] val]]... [-o -k key [[op] val]] ...]...\n", myname);
- fprintf(stderr, " -f read named file[s], rather than standard log message store.\n");
- fprintf(stderr, " -d read all file in named directory path, rather than standard log message store.\n");
- fprintf(stderr, " -x export to named ASL format file, rather than printing\n");
- fprintf(stderr, " -w watch data store (^C to quit)\n");
- fprintf(stderr, " prints the last N matching lines (default 10) before waiting\n");
- fprintf(stderr, " \"-w 0\" prints all matching lines before waiting\n");
- fprintf(stderr, " -F output format may be \"std\", \"raw\", \"bsd\", or \"xml\"\n");
- fprintf(stderr, " format may also be a string containing variables of the form\n");
- fprintf(stderr, " $Key or $(Key) - use the latter for non-whitespace delimited variables\n");
- fprintf(stderr, " -T timestamp format may be \"sec\" (seconds), \"utc\" (UTC), or \"local\" (local timezone)\n");
- fprintf(stderr, " -E text encoding may be \"vis\", \"safe\", or \"none\"\n");
- fprintf(stderr, " -u print timestamps using UTC (equivalent to \"-T utc\")\n");
- fprintf(stderr, " -k key/value match\n");
- fprintf(stderr, " if no operator or value is given, checks for the existance of the key\n");
- fprintf(stderr, " if no operator is given, default is \"%s\"\n", OP_EQ);
- fprintf(stderr, " -C alias for \"-k Facility com.apple.console\"\n");
- fprintf(stderr, " -o begins a new query\n");
- fprintf(stderr, " queries are \'OR\'ed together\n");
- fprintf(stderr, "operators are zero or more modifiers followed by a comparison\n");
- fprintf(stderr, " %s equal\n", OP_EQ);
- fprintf(stderr, " %s not equal\n", OP_NE);
- fprintf(stderr, " %s greater than\n", OP_GT);
- fprintf(stderr, " %s greater or equal\n", OP_GE);
- fprintf(stderr, " %s less than\n", OP_LT);
- fprintf(stderr, " %s less or equal\n", OP_LE);
- fprintf(stderr, "optional modifiers for operators\n");
- fprintf(stderr, " %c case-fold\n", MOD_CASE_FOLD);
- fprintf(stderr, " %c regular expression\n", MOD_REGEX);
- fprintf(stderr, " %c substring\n", MOD_SUBSTRING);
- fprintf(stderr, " %c prefix\n", MOD_PREFIX);
- fprintf(stderr, " %c suffix\n", MOD_SUFFIX);
- fprintf(stderr, " %c numeric comparison\n", MOD_NUMERIC);
+
+ if ((section == HELP_ALL) || (section == HELP_SEND))
+ {
+ fprintf(stderr, "%s -s [-r host] [-l level] message...\n", myname);
+ fprintf(stderr, " send a message\n");
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "%s -s [-r host] -k key val [key val]...\n", myname);
+ fprintf(stderr, " send a message with the given keys and values\n");
+ fprintf(stderr, "\n");
+ }
+
+ if ((section == HELP_ALL) || (section == HELP_REMOTE_CONTROL))
+ {
+ fprintf(stderr, "%s -c process [mask] [-s [on|off]] [-t [on|off]]\n", myname);
+ fprintf(stderr, " get (set if mask or actions are specified) syslog filter mask and actions for process (pid or name)\n");
+ fprintf(stderr, " mask may be any combination of the characters \"p a c e w n i d\"\n");
+ fprintf(stderr, " p = Emergency (\"Panic\")\n");
+ fprintf(stderr, " a = Alert\n");
+ fprintf(stderr, " c = Critical\n");
+ fprintf(stderr, " e = Error\n");
+ fprintf(stderr, " w = Warning\n");
+ fprintf(stderr, " n = Notice\n");
+ fprintf(stderr, " i = Info\n");
+ fprintf(stderr, " d = Debug\n");
+ fprintf(stderr, " a minus sign preceding a single letter means \"up to\" that level\n");
+ fprintf(stderr, " use \"0\" for process to get or set master syslog flags\n");
+ fprintf(stderr, " use \"-c process off\" to deactivate current settings\n");
+ fprintf(stderr, " -s controls sending ASL mesages (to syslogd)\n");
+ fprintf(stderr, " -t controls sending Activity Tracing mesages\n");
+ fprintf(stderr, "\n");
+ }
+
+ if ((section == HELP_ALL) || (section == HELP_CONFIG))
+ {
+ fprintf(stderr, "%s -config [params...]\n", myname);
+ fprintf(stderr, " without params, fetch and print syslogd parameters and statistics\n");
+ fprintf(stderr, " otherwise, set or reset syslogd configuration parameters\n");
+ fprintf(stderr, "\n");
+ }
+
+ if ((section == HELP_ALL) || (section == HELP_MODULE))
+ {
+ fprintf(stderr, "%s -module [name [action]]\n", myname);
+ fprintf(stderr, " with no name, prints configuration for all ASL output modules\n");
+ fprintf(stderr, " with name and no action, prints configuration for named ASL output module\n");
+ fprintf(stderr, " supported actions - module name required, use '*' (with single quotes) for all modules:\n");
+ fprintf(stderr, " enable [01] enables (or disables with 0) named module\n");
+ fprintf(stderr, " does not apply to com.apple.asl when '*' is used\n");
+ fprintf(stderr, " checkpoint [file] checkpoints all files or specified file for named module\n");
+ fprintf(stderr, "\n");
+ }
+
+ if ((section == HELP_ALL) || (section == HELP_SEARCH))
+ {
+ fprintf(stderr, "%s [-f file...] [-d path...] [-x file] [-w [N]] [-F format] [-nocompress] [-u] [-sort key1 [key2]] [-nsort key1 [key2]] [-k key [[op] val]]... [-o -k key [[op] val]] ...]...\n", myname);
+ fprintf(stderr, " -f read named file[s], rather than standard log message store.\n");
+ fprintf(stderr, " -d read all file in named directory path, rather than standard log message store.\n");
+ fprintf(stderr, " -x export to named ASL format file, rather than printing\n");
+ fprintf(stderr, " -w watch data store (^C to quit)\n");
+ fprintf(stderr, " prints the last N matching lines (default 10) before waiting\n");
+ fprintf(stderr, " \"-w all\" prints all matching lines before waiting\n");
+ fprintf(stderr, " \"-w boot\" prints all matching lines since last system boot before waiting\n");
+ fprintf(stderr, " -F output format may be \"std\", \"raw\", \"bsd\", or \"xml\"\n");
+ fprintf(stderr, " format may also be a string containing variables of the form\n");
+ fprintf(stderr, " $Key or $(Key) - use the latter for non-whitespace delimited variables\n");
+ fprintf(stderr, " -T timestamp format may be \"sec\" (seconds), \"utc\" (UTC), or \"local\" (local timezone)\n");
+ fprintf(stderr, " -E text encoding may be \"vis\", \"safe\", or \"none\"\n");
+ fprintf(stderr, " -nodc no duplicate message compression\n");
+ fprintf(stderr, " -u print timestamps using UTC (equivalent to \"-T utc\")\n");
+ fprintf(stderr, " -sort sort messages using value for specified key1 (secondary sort by key2 if provided)\n");
+ fprintf(stderr, " -nsort numeric sort messages using value for specified key1 (secondary sort by key2 if provided)\n");
+ fprintf(stderr, " -k key/value match\n");
+ fprintf(stderr, " if no operator or value is given, checks for the existence of the key\n");
+ fprintf(stderr, " if no operator is given, default is \"%s\"\n", OP_EQ);
+ fprintf(stderr, " -B only process log messages since last system boot\n");
+ fprintf(stderr, " -C alias for \"-k Facility com.apple.console\"\n");
+ fprintf(stderr, " -o begins a new query\n");
+ fprintf(stderr, " queries are \'OR\'ed together\n");
+ fprintf(stderr, "operators are zero or more modifiers followed by a comparison\n");
+ fprintf(stderr, " %s equal\n", OP_EQ);
+ fprintf(stderr, " %s not equal\n", OP_NE);
+ fprintf(stderr, " %s greater than\n", OP_GT);
+ fprintf(stderr, " %s greater or equal\n", OP_GE);
+ fprintf(stderr, " %s less than\n", OP_LT);
+ fprintf(stderr, " %s less or equal\n", OP_LE);
+ fprintf(stderr, "optional modifiers for operators\n");
+ fprintf(stderr, " %c case-fold\n", MOD_CASE_FOLD);
+ fprintf(stderr, " %c regular expression\n", MOD_REGEX);
+ fprintf(stderr, " %c substring\n", MOD_SUBSTRING);
+ fprintf(stderr, " %c prefix\n", MOD_PREFIX);
+ fprintf(stderr, " %c suffix\n", MOD_SUFFIX);
+ fprintf(stderr, " %c numeric comparison\n", MOD_NUMERIC);
+ fprintf(stderr, "\n");
+ }
+
+ if ((section == HELP_ALL) || (section == HELP_STATS))
+ {
+ fprintf(stderr, "%s -stats [-n n] [-d path] [-v]\n", myname);
+ fprintf(stderr, " compiles and prints syslogd usage statistics\n");
+ fprintf(stderr, " -n n prints stats for just the top n (e.g. top 10) senders\n");
+ fprintf(stderr, " -d path reads the ASL database at the given path for statistics\n");
+ fprintf(stderr, " -v verbose ([message_count total_data data_average] for 10 minute intervals)\n");
+ fprintf(stderr, "\n");
+ }
+
+ fprintf(stderr, "NOTE: Most system logs have moved to a new logging system. See log(1) for more information.\n");