Remove the --signal-list option

This commit is contained in:
Shuanglei Tao
2017-11-05 09:46:17 +08:00
parent 784ac09f05
commit a59da79d62
7 changed files with 48 additions and 68 deletions

View File

@@ -77,28 +77,27 @@ VERSION:
1.3.3 1.3.3
OPTIONS: OPTIONS:
--port, -p Port to listen (default: 7681, use `0` for random port) -p, --port 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) -i, --interface 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) -c, --credential Credential for Basic Authentication (format: username:password)
--uid, -u User id to run with -u, --uid User id to run with
--gid, -g Group id to run with -g, --gid Group id to run with
--signal, -s Signal to send to the command when exit it (default: SIGHUP) -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)
--reconnect, -r Time to reconnect for the client in seconds (default: 10) -R, --readonly Do not allow clients to write to the TTY
--readonly, -R Do not allow clients to write to the TTY -t, --client-option Send option to client (format: key=value), repeat to add more options
--client-option, -t Send option to client (format: key=value), repeat to add more options -O, --check-origin Do not allow websocket connection from different origin
--check-origin, -O Do not allow websocket connection from different origin -m, --max-clients Maximum clients to support (default: 0, no limit)
--max-clients, -m Maximum clients to support (default: 0, no limit) -o, --once Accept only one client and exit on disconnection
--once, -o Accept only one client and exit on disconnection -B, --browser Open terminal with the default system browser
--browser, -B Open terminal with the default system browser -I, --index Custom index.html path
--index, -I Custom index.html path -S, --ssl Enable SSL
--ssl, -S Enable SSL -C, --ssl-cert SSL certificate file path
--ssl-cert, -C SSL certificate file path -K, --ssl-key SSL key file path
--ssl-key, -K SSL key file path -A, --ssl-ca SSL CA file path for client certificate verification
--ssl-ca, -A SSL CA file path for client certificate verification -d, --debug Set log level (default: 7)
--debug, -d Set log level (default: 7) -v, --version Print the version and exit
--version, -v Print the version and exit -h, --help Print this text and exit
--help, -h Print this text and exit
Visit https://github.com/tsl0922/ttyd to get more information and report bugs. Visit https://github.com/tsl0922/ttyd to get more information and report bugs.
``` ```

6
man/README.md Normal file
View File

@@ -0,0 +1,6 @@
# Building the man page
```bash
go get github.com/cpuguy83/go-md2man
go-md2man < ttyd.man.md > ttyd.1
```

View File

@@ -52,10 +52,6 @@ Cross platform: macOS, Linux, FreeBSD/OpenBSD, OpenWrt/LEDE, Windows
\-s, \-\-signal <signal string> \-s, \-\-signal <signal string>
Signal to send to the command when exit it (default: SIGHUP) Signal to send to the command when exit it (default: SIGHUP)
.PP
\-\-signal\-list
Print a list of supported signals
.PP .PP
\-r, \-\-reconnect <seconds> \-r, \-\-reconnect <seconds>
Time to reconnect for the client in seconds (default: 10) Time to reconnect for the client in seconds (default: 10)

View File

@@ -36,9 +36,6 @@ ttyd 1 "September 2016" ttyd "User Manual"
-s, --signal <signal string> -s, --signal <signal string>
Signal to send to the command when exit it (default: SIGHUP) Signal to send to the command when exit it (default: SIGHUP)
--signal-list
Print a list of supported signals
-r, --reconnect <seconds> -r, --reconnect <seconds>
Time to reconnect for the client in seconds (default: 10) Time to reconnect for the client in seconds (default: 10)

View File

@@ -52,28 +52,27 @@ void print_help() {
"VERSION:\n" "VERSION:\n"
" %s\n\n" " %s\n\n"
"OPTIONS:\n" "OPTIONS:\n"
" --port, -p Port to listen (default: 7681, use `0` for random port)\n" " -p, --port 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" " -i, --interface 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" " -c, --credential Credential for Basic Authentication (format: username:password)\n"
" --uid, -u User id to run with\n" " -u, --uid User id to run with\n"
" --gid, -g Group id to run with\n" " -g, --gid Group id to run with\n"
" --signal, -s Signal to send to the command when exit it (default: SIGHUP)\n" " -s, --signal Signal to send to the command when exit it (default: SIGHUP)\n"
" --signal-list Print a list of supported signals\n" " -r, --reconnect Time to reconnect for the client in seconds (default: 10)\n"
" --reconnect, -r Time to reconnect for the client in seconds (default: 10)\n" " -R, --readonly Do not allow clients to write to the TTY\n"
" --readonly, -R 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"
" --client-option, -t 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"
" --check-origin, -O Do not allow websocket connection from different origin\n" " -m, --max-clients Maximum clients to support (default: 0, no limit)\n"
" --max-clients, -m Maximum clients to support (default: 0, no limit)\n" " -o, --once Accept only one client and exit on disconnection\n"
" --once, -o Accept only one client and exit on disconnection\n" " -B, --browser Open terminal with the default system browser\n"
" --browser, -B Open terminal with the default system browser\n" " -I, --index Custom index.html path\n"
" --index, -I Custom index.html path\n" " -S, --ssl Enable SSL\n"
" --ssl, -S Enable SSL\n" " -C, --ssl-cert SSL certificate file path\n"
" --ssl-cert, -C SSL certificate file path\n" " -K, --ssl-key SSL key file path\n"
" --ssl-key, -K SSL key file path\n" " -A, --ssl-ca SSL CA file path for client certificate verification\n"
" --ssl-ca, -A SSL CA file path for client certificate verification\n" " -d, --debug Set log level (default: 7)\n"
" --debug, -d Set log level (default: 7)\n" " -v, --version Print the version and exit\n"
" --version, -v Print the version and exit\n" " -h, --help Print this text and exit\n\n"
" --help, -h Print this text and exit\n\n"
"Visit https://github.com/tsl0922/ttyd to get more information and report bugs.\n", "Visit https://github.com/tsl0922/ttyd to get more information and report bugs.\n",
TTYD_VERSION TTYD_VERSION
); );
@@ -235,9 +234,6 @@ main(int argc, char **argv) {
int c; int c;
while ((c = getopt_long(start, argv, opt_string, options, NULL)) != -1) { while ((c = getopt_long(start, argv, opt_string, options, NULL)) != -1) {
switch (c) { switch (c) {
case 1:
print_sig_list();
exit(EXIT_SUCCESS);
case 'h': case 'h':
print_help(); print_help();
return 0; return 0;

View File

@@ -88,16 +88,6 @@ get_sig(const char *sig_name) {
return -1; 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 int
open_uri(char *uri) { open_uri(char *uri) {
#ifdef __APPLE__ #ifdef __APPLE__

View File

@@ -25,10 +25,6 @@ get_sig_name(int sig, char *buf);
int int
get_sig(const char *sig_name); get_sig(const char *sig_name);
// print signal list
void
print_sig_list();
// Open uri with the default application of system // Open uri with the default application of system
int int
open_uri(char *uri); open_uri(char *uri);