Skip to content

Commit a59da79

Browse files
committed
Remove the --signal-list option
1 parent 784ac09 commit a59da79

File tree

7 files changed

+48
-68
lines changed

7 files changed

+48
-68
lines changed

README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,27 @@ VERSION:
7777
1.3.3
7878
7979
OPTIONS:
80-
--port, -p Port to listen (default: 7681, use `0` for random port)
81-
--interface, -i Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
82-
--credential, -c Credential for Basic Authentication (format: username:password)
83-
--uid, -u User id to run with
84-
--gid, -g Group id to run with
85-
--signal, -s Signal to send to the command when exit it (default: SIGHUP)
86-
--signal-list Print a list of supported signals
87-
--reconnect, -r Time to reconnect for the client in seconds (default: 10)
88-
--readonly, -R Do not allow clients to write to the TTY
89-
--client-option, -t Send option to client (format: key=value), repeat to add more options
90-
--check-origin, -O Do not allow websocket connection from different origin
91-
--max-clients, -m Maximum clients to support (default: 0, no limit)
92-
--once, -o Accept only one client and exit on disconnection
93-
--browser, -B Open terminal with the default system browser
94-
--index, -I Custom index.html path
95-
--ssl, -S Enable SSL
96-
--ssl-cert, -C SSL certificate file path
97-
--ssl-key, -K SSL key file path
98-
--ssl-ca, -A SSL CA file path for client certificate verification
99-
--debug, -d Set log level (default: 7)
100-
--version, -v Print the version and exit
101-
--help, -h Print this text and exit
80+
-p, --port Port to listen (default: 7681, use `0` for random port)
81+
-i, --interface Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
82+
-c, --credential Credential for Basic Authentication (format: username:password)
83+
-u, --uid User id to run with
84+
-g, --gid Group id to run with
85+
-s, --signal Signal to send to the command when exit it (default: SIGHUP)
86+
-r, --reconnect Time to reconnect for the client in seconds (default: 10)
87+
-R, --readonly Do not allow clients to write to the TTY
88+
-t, --client-option Send option to client (format: key=value), repeat to add more options
89+
-O, --check-origin Do not allow websocket connection from different origin
90+
-m, --max-clients Maximum clients to support (default: 0, no limit)
91+
-o, --once Accept only one client and exit on disconnection
92+
-B, --browser Open terminal with the default system browser
93+
-I, --index Custom index.html path
94+
-S, --ssl Enable SSL
95+
-C, --ssl-cert SSL certificate file path
96+
-K, --ssl-key SSL key file path
97+
-A, --ssl-ca SSL CA file path for client certificate verification
98+
-d, --debug Set log level (default: 7)
99+
-v, --version Print the version and exit
100+
-h, --help Print this text and exit
102101
103102
Visit https://github.com/tsl0922/ttyd to get more information and report bugs.
104103
```

man/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Building the man page
2+
3+
```bash
4+
go get github.com/cpuguy83/go-md2man
5+
go-md2man < ttyd.man.md > ttyd.1
6+
```

man/ttyd.1

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ Cross platform: macOS, Linux, FreeBSD/OpenBSD, OpenWrt/LEDE, Windows
5252
\-s, \-\-signal <signal string>
5353
Signal to send to the command when exit it (default: SIGHUP)
5454

55-
.PP
56-
\-\-signal\-list
57-
Print a list of supported signals
58-
5955
.PP
6056
\-r, \-\-reconnect <seconds>
6157
Time to reconnect for the client in seconds (default: 10)

man/ttyd.man.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ ttyd 1 "September 2016" ttyd "User Manual"
3636
-s, --signal <signal string>
3737
Signal to send to the command when exit it (default: SIGHUP)
3838

39-
--signal-list
40-
Print a list of supported signals
41-
4239
-r, --reconnect <seconds>
4340
Time to reconnect for the client in seconds (default: 10)
4441

src/server.c

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,27 @@ void print_help() {
5252
"VERSION:\n"
5353
" %s\n\n"
5454
"OPTIONS:\n"
55-
" --port, -p Port to listen (default: 7681, use `0` for random port)\n"
56-
" --interface, -i Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)\n"
57-
" --credential, -c Credential for Basic Authentication (format: username:password)\n"
58-
" --uid, -u User id to run with\n"
59-
" --gid, -g Group id to run with\n"
60-
" --signal, -s Signal to send to the command when exit it (default: SIGHUP)\n"
61-
" --signal-list Print a list of supported signals\n"
62-
" --reconnect, -r Time to reconnect for the client in seconds (default: 10)\n"
63-
" --readonly, -R Do not allow clients to write to the TTY\n"
64-
" --client-option, -t Send option to client (format: key=value), repeat to add more options\n"
65-
" --check-origin, -O Do not allow websocket connection from different origin\n"
66-
" --max-clients, -m Maximum clients to support (default: 0, no limit)\n"
67-
" --once, -o Accept only one client and exit on disconnection\n"
68-
" --browser, -B Open terminal with the default system browser\n"
69-
" --index, -I Custom index.html path\n"
70-
" --ssl, -S Enable SSL\n"
71-
" --ssl-cert, -C SSL certificate file path\n"
72-
" --ssl-key, -K SSL key file path\n"
73-
" --ssl-ca, -A SSL CA file path for client certificate verification\n"
74-
" --debug, -d Set log level (default: 7)\n"
75-
" --version, -v Print the version and exit\n"
76-
" --help, -h Print this text and exit\n\n"
55+
" -p, --port Port to listen (default: 7681, use `0` for random port)\n"
56+
" -i, --interface Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)\n"
57+
" -c, --credential Credential for Basic Authentication (format: username:password)\n"
58+
" -u, --uid User id to run with\n"
59+
" -g, --gid Group id to run with\n"
60+
" -s, --signal Signal to send to the command when exit it (default: SIGHUP)\n"
61+
" -r, --reconnect Time to reconnect for the client in seconds (default: 10)\n"
62+
" -R, --readonly Do not allow clients to write to the TTY\n"
63+
" -t, --client-option Send option to client (format: key=value), repeat to add more options\n"
64+
" -O, --check-origin Do not allow websocket connection from different origin\n"
65+
" -m, --max-clients Maximum clients to support (default: 0, no limit)\n"
66+
" -o, --once Accept only one client and exit on disconnection\n"
67+
" -B, --browser Open terminal with the default system browser\n"
68+
" -I, --index Custom index.html path\n"
69+
" -S, --ssl Enable SSL\n"
70+
" -C, --ssl-cert SSL certificate file path\n"
71+
" -K, --ssl-key SSL key file path\n"
72+
" -A, --ssl-ca SSL CA file path for client certificate verification\n"
73+
" -d, --debug Set log level (default: 7)\n"
74+
" -v, --version Print the version and exit\n"
75+
" -h, --help Print this text and exit\n\n"
7776
"Visit https://github.com/tsl0922/ttyd to get more information and report bugs.\n",
7877
TTYD_VERSION
7978
);
@@ -235,9 +234,6 @@ main(int argc, char **argv) {
235234
int c;
236235
while ((c = getopt_long(start, argv, opt_string, options, NULL)) != -1) {
237236
switch (c) {
238-
case 1:
239-
print_sig_list();
240-
exit(EXIT_SUCCESS);
241237
case 'h':
242238
print_help();
243239
return 0;

src/utils.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,6 @@ get_sig(const char *sig_name) {
8888
return -1;
8989
}
9090

91-
void print_sig_list() {
92-
char name[30];
93-
for (int sig = 1; sig < NSIG; sig++) {
94-
if (sys_signame[sig] != NULL) {
95-
strcpy(name, sys_signame[sig]);
96-
printf("%2d) SIG%s (%s)\n", sig, uppercase(name), strsignal(sig));
97-
}
98-
}
99-
}
100-
10191
int
10292
open_uri(char *uri) {
10393
#ifdef __APPLE__

src/utils.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ get_sig_name(int sig, char *buf);
2525
int
2626
get_sig(const char *sig_name);
2727

28-
// print signal list
29-
void
30-
print_sig_list();
31-
3228
// Open uri with the default application of system
3329
int
3430
open_uri(char *uri);

0 commit comments

Comments
 (0)