From: Shuanglei Tao Date: Sun, 5 Nov 2017 01:46:17 +0000 (+0800) Subject: Remove the --signal-list option X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=a59da79d62bd9e9abc948ba891978e85e91414ea;p=ttyd.git Remove the --signal-list option --- diff --git a/README.md b/README.md index 5c11511..d13c195 100644 --- a/README.md +++ b/README.md @@ -77,28 +77,27 @@ VERSION: 1.3.3 OPTIONS: - --port, -p Port to listen (default: 7681, use `0` for random port) - --interface, -i Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock) - --credential, -c Credential for Basic Authentication (format: username:password) - --uid, -u User id to run with - --gid, -g Group id to run with - --signal, -s Signal to send to the command when exit it (default: SIGHUP) - --signal-list Print a list of supported signals - --reconnect, -r Time to reconnect for the client in seconds (default: 10) - --readonly, -R Do not allow clients to write to the TTY - --client-option, -t Send option to client (format: key=value), repeat to add more options - --check-origin, -O Do not allow websocket connection from different origin - --max-clients, -m Maximum clients to support (default: 0, no limit) - --once, -o Accept only one client and exit on disconnection - --browser, -B Open terminal with the default system browser - --index, -I Custom index.html path - --ssl, -S Enable SSL - --ssl-cert, -C SSL certificate file path - --ssl-key, -K SSL key file path - --ssl-ca, -A SSL CA file path for client certificate verification - --debug, -d Set log level (default: 7) - --version, -v Print the version and exit - --help, -h Print this text and exit + -p, --port Port to listen (default: 7681, use `0` for random port) + -i, --interface Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock) + -c, --credential Credential for Basic Authentication (format: username:password) + -u, --uid User id to run with + -g, --gid Group id to run with + -s, --signal Signal to send to the command when exit it (default: SIGHUP) + -r, --reconnect Time to reconnect for the client in seconds (default: 10) + -R, --readonly Do not allow clients to write to the TTY + -t, --client-option Send option to client (format: key=value), repeat to add more options + -O, --check-origin Do not allow websocket connection from different origin + -m, --max-clients Maximum clients to support (default: 0, no limit) + -o, --once Accept only one client and exit on disconnection + -B, --browser Open terminal with the default system browser + -I, --index Custom index.html path + -S, --ssl Enable SSL + -C, --ssl-cert SSL certificate file path + -K, --ssl-key SSL key file path + -A, --ssl-ca SSL CA file path for client certificate verification + -d, --debug Set log level (default: 7) + -v, --version Print the version and exit + -h, --help Print this text and exit Visit https://github.com/tsl0922/ttyd to get more information and report bugs. ``` diff --git a/man/README.md b/man/README.md new file mode 100644 index 0000000..c988e97 --- /dev/null +++ b/man/README.md @@ -0,0 +1,6 @@ +# Building the man page + +```bash +go get github.com/cpuguy83/go-md2man +go-md2man < ttyd.man.md > ttyd.1 +``` \ No newline at end of file diff --git a/man/ttyd.1 b/man/ttyd.1 index 1f5bb14..3611222 100644 --- a/man/ttyd.1 +++ b/man/ttyd.1 @@ -52,10 +52,6 @@ Cross platform: macOS, Linux, FreeBSD/OpenBSD, OpenWrt/LEDE, Windows \-s, \-\-signal Signal to send to the command when exit it (default: SIGHUP) -.PP -\-\-signal\-list - Print a list of supported signals - .PP \-r, \-\-reconnect Time to reconnect for the client in seconds (default: 10) diff --git a/man/ttyd.man.md b/man/ttyd.man.md index 9d30e50..bae30f8 100644 --- a/man/ttyd.man.md +++ b/man/ttyd.man.md @@ -36,9 +36,6 @@ ttyd 1 "September 2016" ttyd "User Manual" -s, --signal Signal to send to the command when exit it (default: SIGHUP) - --signal-list - Print a list of supported signals - -r, --reconnect Time to reconnect for the client in seconds (default: 10) diff --git a/src/server.c b/src/server.c index 7c71110..ddb2db5 100644 --- a/src/server.c +++ b/src/server.c @@ -52,28 +52,27 @@ void print_help() { "VERSION:\n" " %s\n\n" "OPTIONS:\n" - " --port, -p Port to listen (default: 7681, use `0` for random port)\n" - " --interface, -i Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)\n" - " --credential, -c Credential for Basic Authentication (format: username:password)\n" - " --uid, -u User id to run with\n" - " --gid, -g Group id to run with\n" - " --signal, -s Signal to send to the command when exit it (default: SIGHUP)\n" - " --signal-list Print a list of supported signals\n" - " --reconnect, -r Time to reconnect for the client in seconds (default: 10)\n" - " --readonly, -R Do not allow clients to write to the TTY\n" - " --client-option, -t Send option to client (format: key=value), repeat to add more options\n" - " --check-origin, -O Do not allow websocket connection from different origin\n" - " --max-clients, -m Maximum clients to support (default: 0, no limit)\n" - " --once, -o Accept only one client and exit on disconnection\n" - " --browser, -B Open terminal with the default system browser\n" - " --index, -I Custom index.html path\n" - " --ssl, -S Enable SSL\n" - " --ssl-cert, -C SSL certificate file path\n" - " --ssl-key, -K SSL key file path\n" - " --ssl-ca, -A SSL CA file path for client certificate verification\n" - " --debug, -d Set log level (default: 7)\n" - " --version, -v Print the version and exit\n" - " --help, -h Print this text and exit\n\n" + " -p, --port Port to listen (default: 7681, use `0` for random port)\n" + " -i, --interface Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)\n" + " -c, --credential Credential for Basic Authentication (format: username:password)\n" + " -u, --uid User id to run with\n" + " -g, --gid Group id to run with\n" + " -s, --signal Signal to send to the command when exit it (default: SIGHUP)\n" + " -r, --reconnect Time to reconnect for the client in seconds (default: 10)\n" + " -R, --readonly Do not allow clients to write to the TTY\n" + " -t, --client-option Send option to client (format: key=value), repeat to add more options\n" + " -O, --check-origin Do not allow websocket connection from different origin\n" + " -m, --max-clients Maximum clients to support (default: 0, no limit)\n" + " -o, --once Accept only one client and exit on disconnection\n" + " -B, --browser Open terminal with the default system browser\n" + " -I, --index Custom index.html path\n" + " -S, --ssl Enable SSL\n" + " -C, --ssl-cert SSL certificate file path\n" + " -K, --ssl-key SSL key file path\n" + " -A, --ssl-ca SSL CA file path for client certificate verification\n" + " -d, --debug Set log level (default: 7)\n" + " -v, --version Print the version and exit\n" + " -h, --help Print this text and exit\n\n" "Visit https://github.com/tsl0922/ttyd to get more information and report bugs.\n", TTYD_VERSION ); @@ -235,9 +234,6 @@ main(int argc, char **argv) { int c; while ((c = getopt_long(start, argv, opt_string, options, NULL)) != -1) { switch (c) { - case 1: - print_sig_list(); - exit(EXIT_SUCCESS); case 'h': print_help(); return 0; diff --git a/src/utils.c b/src/utils.c index af6ead5..b2fe8d6 100644 --- a/src/utils.c +++ b/src/utils.c @@ -88,16 +88,6 @@ get_sig(const char *sig_name) { return -1; } -void print_sig_list() { - char name[30]; - for (int sig = 1; sig < NSIG; sig++) { - if (sys_signame[sig] != NULL) { - strcpy(name, sys_signame[sig]); - printf("%2d) SIG%s (%s)\n", sig, uppercase(name), strsignal(sig)); - } - } -} - int open_uri(char *uri) { #ifdef __APPLE__ diff --git a/src/utils.h b/src/utils.h index ceef702..7ac0008 100644 --- a/src/utils.h +++ b/src/utils.h @@ -25,10 +25,6 @@ get_sig_name(int sig, char *buf); int get_sig(const char *sig_name); -// print signal list -void -print_sig_list(); - // Open uri with the default application of system int open_uri(char *uri);