client: update help text

Update the text for recent changes, add missing commands and indent the
description in the output.
This commit is contained in:
Miroslav Lichvar 2015-09-25 16:02:04 +02:00
parent 7b2430fc3c
commit a4d9cfaaeb

132
client.c
View file

@ -1184,59 +1184,85 @@ process_cmd_delete(CMD_Request *msg, char *line)
static void static void
give_help(void) give_help(void)
{ {
printf("Commands:\n"); int line, len;
printf("accheck <address> : Check whether NTP access is allowed to <address>\n"); const char *s, cols[] =
printf("activity : Check how many NTP sources are online/offline\n"); "System clock:\0\0"
printf("add peer <address> ... : Add a new NTP peer\n"); "tracking\0Display system time information\0"
printf("add server <address> ... : Add a new NTP server\n"); "makestep\0Correct clock by stepping immediately\0"
printf("allow [<subnet-addr>] : Allow NTP access to that subnet as a default\n"); "makestep [<threshold> <updates>]\0Configure automatic clock stepping\0"
printf("allow all [<subnet-addr>] : Allow NTP access to that subnet and all children\n"); "maxupdateskew <skew>\0Modify maximum valid skew to update frequency\0"
printf("burst <n-good>/<n-max> [<mask>/<masked-address>] : Start a rapid set of measurements\n"); "waitsync [max-tries [max-correction [max-skew]]]\0"
printf("clients : Report on clients that have accessed the server\n"); "Wait until synchronised in specified limits\0"
printf("cmdaccheck <address> : Check whether command access is allowed to <address>\n"); "\0\0"
printf("cmdallow [<subnet-addr>] : Allow command access to that subnet as a default\n"); "Time sources:\0\0"
printf("cmdallow all [<subnet-addr>] : Allow command access to that subnet and all children\n"); "sources [-v]\0Display information about current sources\0"
printf("cmddeny [<subnet-addr>] : Deny command access to that subnet as a default\n"); "sourcestats [-v]\0Display statistics about collected measurements\0"
printf("cmddeny all [<subnet-addr>] : Deny command access to that subnet and all children\n"); "reselect\0Force reselecting synchronisation source\0"
printf("cyclelogs : Close and re-open logs files\n"); "\0\0"
printf("delete <address> : Remove an NTP server or peer\n"); "NTP sources:\0\0"
printf("deny [<subnet-addr>] : Deny NTP access to that subnet as a default\n"); "activity\0Check how many NTP sources are online/offline\0"
printf("deny all [<subnet-addr>] : Deny NTP access to that subnet and all children\n"); "add server <address> [options]\0Add new NTP server\0"
printf("dump : Dump all measurements to save files\n"); "add peer <address> [options]\0Add new NTP peer\0"
printf("local off : Disable server capability for unsynchronised clock\n"); "delete <address>\0Remove server or peer\0"
printf("local stratum <stratum> : Enable server capability for unsynchronised clock\n"); "burst <n-good>/<n-max> [<mask>/<address>]\0Start rapid set of measurements\0"
printf("makestep [<threshold> <updates>] : Correct clock by stepping\n"); "maxdelay <address> <delay>\0Modify maximum valid sample delay\0"
printf("manual off|on|reset : Disable/enable/reset settime command and statistics\n"); "maxdelayratio <address> <ratio>\0Modify maximum valid delay/minimum ratio\0"
printf("manual list : Show previous settime entries\n"); "maxdelaydevratio <address> <ratio>\0Modify maximum valid delay/deviation ratio\0"
printf("maxdelay <address> <new-max-delay> : Modify maximum round-trip valid sample delay for source\n"); "minpoll <address> <poll>\0Modify minimum polling interval\0"
printf("maxdelayratio <address> <new-max-ratio> : Modify max round-trip delay ratio for source\n"); "maxpoll <address> <poll>\0Modify maximum polling interval\0"
printf("maxdelaydevratio <address> <new-max-ratio> : Modify max round-trip delay dev ratio for source\n"); "minstratum <address> <stratum>\0Modify minimum stratum\0"
printf("maxpoll <address> <new-maxpoll> : Modify maximum polling interval of source\n"); "offline [<mask>/<address>]\0Set sources in subnet to offline status\0"
printf("maxupdateskew <new-max-skew> : Modify maximum skew for a clock frequency update to be made\n"); "online [<mask>/<address>]\0Set sources in subnet to online status\0"
printf("minpoll <address> <new-minpoll> : Modify minimum polling interval of source\n"); "polltarget <address> <target>\0Modify poll target of source\0"
printf("minstratum <address> <new-min-stratum> : Modify minimum stratum of source\n"); "\0\0"
printf("offline [<mask>/<masked-address>] : Set sources in subnet to offline status\n"); "Manual time input:\0\0"
printf("online [<mask>/<masked-address>] : Set sources in subnet to online status\n"); "manual off|on|reset\0Disable/enable/reset settime command\0"
printf("polltarget <address> <new-poll-target> : Modify poll target of source\n"); "manual list\0Show previous settime entries\0"
printf("reselect : Reselect synchronisation source\n"); "manual delete <index>\0Delete previous settime entry\0"
printf("rtcdata : Print current RTC performance parameters\n"); "settime <time>\0Set daemon time\0"
printf("settime <date/time (e.g. Nov 21, 1997 16:30:05 or 16:30:05)> : Manually set the daemon time\n"); "\0(e.g. Sep 25, 2015 16:30:05 or 16:30:05)\0"
printf("smoothing : Display current time smoothing state\n"); "\0\0NTP access:\0\0"
printf("smoothtime reset|activate : Reset/activate time smoothing\n"); "accheck <address>\0Check whether address is allowed\0"
printf("sources [-v] : Display information about current sources\n"); "clients\0Report on clients that have accessed the server\0"
printf("sourcestats [-v] : Display estimation information about current sources\n"); "allow [<subnet>]\0Allow access to subnet as a default\0"
printf("tracking : Display system time information\n"); "allow all [<subnet>]\0Allow access to subnet and all children\0"
printf("trimrtc : Correct RTC relative to system clock\n"); "deny [<subnet>]\0Deny access to subnet as a default\0"
printf("waitsync [max-tries [max-correction [max-skew]]] : Wait until synchronised\n"); "deny all [<subnet>]\0Deny access to subnet and all children\0"
printf("writertc : Save RTC parameters to file\n"); "local stratum <stratum>\0Serve time at stratum when not synchronised\0"
printf("\n"); "local off\0Don't serve time when not synchronised\0"
printf("dns -n|+n : Disable/enable resolving IP addresses to hostnames\n"); "smoothtime reset|activate\0Reset/activate time smoothing\0"
printf("dns -4|-6|-46 : Resolve hostnames only to IPv4/IPv6/both addresses\n"); "smoothing\0Display current time smoothing state\0"
printf("timeout <milliseconds> : Set initial response timeout\n"); "\0\0"
printf("retries <n> : Set maximum number of retries\n"); "Monitoring access:\0\0"
printf("exit|quit : Leave the program\n"); "cmdaccheck <address>\0Check whether address is allowed\0"
printf("help : Generate this help\n"); "cmdallow [<subnet>]\0Allow access to subnet as a default\0"
printf("\n"); "cmdallow all [<subnet>]\0Allow access to subnet and all children\0"
"cmddeny [<subnet>]\0Deny access to subnet as a default\0"
"cmddeny all [<subnet>]\0Deny access to subnet and all children\0"
"\0\0"
"Real-time clock:\0\0"
"rtcdata\0Print current RTC performance parameters\0"
"trimrtc\0Correct RTC relative to system clock\0"
"writertc\0Save RTC performance parameters to file\0"
"\0\0"
"Other daemon commands:\0\0"
"cyclelogs\0Close and re-open log files\0"
"dump\0Dump all measurements to save files\0"
"\0\0"
"Client commands:\0\0"
"dns -n|+n\0Disable/enable resolving IP addresses to hostnames\0"
"dns -4|-6|-46\0Resolve hostnames only to IPv4/IPv6/both addresses\0"
"timeout <milliseconds>\0Set initial response timeout\0"
"retries <retries>\0Set maximum number of retries\0"
"exit|quit\0Leave the program\0"
"help\0Generate this help\0"
"\0";
/* Indent the second column */
for (s = cols, line = 0; s < cols + sizeof (cols); s += len + 1, line++) {
len = strlen(s);
printf(line % 2 == 0 ? (len >= 28 ? "%s\n%28s" : "%-28s") : "%s\n", s, "");
}
} }
/* ================================================== */ /* ================================================== */