aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2016-01-29 22:02:40 +0100
committerChristoph Lohmann <20h@r-36.net>2016-01-30 09:44:41 +0100
commitbd5fdbe64c8abfb624ad59939ed9b221c8b04eef (patch)
tree4843d04341b6f0b4037af49b8ab34708ed7626f4
parent504a165277c13797840c42c64807b59cd4e5f3a5 (diff)
downloadst-patched-bd5fdbe64c8abfb624ad59939ed9b221c8b04eef.tar.bz2
st-patched-bd5fdbe64c8abfb624ad59939ed9b221c8b04eef.tar.xz
st-patched-bd5fdbe64c8abfb624ad59939ed9b221c8b04eef.zip
Reformat usage and separate version from it
Signed-off-by: Christoph Lohmann <20h@r-36.net>
-rw-r--r--st.138
-rw-r--r--st.c24
2 files changed, 33 insertions, 29 deletions
diff --git a/st.1 b/st.1
index 187a734..fe2e731 100644
--- a/st.1
+++ b/st.1
@@ -3,47 +3,43 @@
3st \- simple terminal 3st \- simple terminal
4.SH SYNOPSIS 4.SH SYNOPSIS
5.B st 5.B st
6.RB [ \-a ] 6.RB [ \-aiv ]
7.RB [ \-c 7.RB [ \-c
8.IR class ] 8.IR class ]
9.RB [ \-f 9.RB [ \-f
10.IR font ] 10.IR font ]
11.RB [ \-g 11.RB [ \-g
12.IR geometry ] 12.IR geometry ]
13.RB [ \-i ]
14.RB [ \-o 13.RB [ \-o
15.IR file ] 14.IR iofile ]
16.RB [ \-t
17.IR title ]
18.RB [ \-T 15.RB [ \-T
19.IR title ] 16.IR title ]
17.RB [ \-t
18.IR title ]
20.RB [ \-l 19.RB [ \-l
21.IR line ] 20.IR line ]
22.RB [ \-w 21.RB [ \-w
23.IR windowid ] 22.IR windowid ]
24.RB [ \-v ] 23.RB [[ \-e ]
25.RB [ \-e 24.IR command
26.IR command ...] 25.RI [ arguments ...]]
27.RI [ commands ...]
28.PP 26.PP
29.B st 27.B st
30.RB [ \-a ] 28.RB [ \-aiv ]
31.RB [ \-c 29.RB [ \-c
32.IR class ] 30.IR class ]
33.RB [ \-f 31.RB [ \-f
34.IR font ] 32.IR font ]
35.RB [ \-g 33.RB [ \-g
36.IR geometry ] 34.IR geometry ]
37.RB [ \-i ]
38.RB [ \-o 35.RB [ \-o
39.IR file ] 36.IR iofile ]
40.RB [ \-t
41.IR title ]
42.RB [ \-T 37.RB [ \-T
43.IR title ] 38.IR title ]
39.RB [ \-t
40.IR title ]
44.RB [ \-w 41.RB [ \-w
45.IR windowid ] 42.IR windowid ]
46.RB [ \-v ]
47.RB \-l 43.RB \-l
48.IR line 44.IR line
49.RI [ stty_args ...] 45.RI [ stty_args ...]
@@ -78,14 +74,14 @@ writes all the I/O to
78This feature is useful when recording st sessions. A value of "-" means 74This feature is useful when recording st sessions. A value of "-" means
79standard output. 75standard output.
80.TP 76.TP
81.BI \-t " title" 77.BI \-T " title"
82defines the window title (default 'st'). 78defines the window title (default 'st').
83.TP 79.TP
84.BI \-T " title" 80.BI \-t " title"
85defines the window title (default 'st'). 81defines the window title (default 'st').
86.TP 82.TP
87.BI \-w " windowid" 83.BI \-w " windowid"
88embeds st within the window identified by 84embeds st within the window identified by
89.I windowid 85.I windowid
90.TP 86.TP
91.BI \-l " line" 87.BI \-l " line"
@@ -111,9 +107,9 @@ for more arguments and cases.
111.B \-v 107.B \-v
112prints version information to stderr, then exits. 108prints version information to stderr, then exits.
113.TP 109.TP
114.BI \-e " program " [ " arguments " "... ]" 110.BI \-e " command " [ " arguments " "... ]"
115st executes 111st executes
116.I program 112.I command
117instead of the shell. If this is used it 113instead of the shell. If this is used it
118.B must be the last option 114.B must be the last option
119on the command line, as in xterm / rxvt. 115on the command line, as in xterm / rxvt.
diff --git a/st.c b/st.c
index 3a0a519..2bbf484 100644
--- a/st.c
+++ b/st.c
@@ -486,6 +486,7 @@ static void *xrealloc(void *, size_t);
486static char *xstrdup(char *); 486static char *xstrdup(char *);
487 487
488static void usage(void); 488static void usage(void);
489static void version(void);
489 490
490static void (*handler[LASTEvent])(XEvent *) = { 491static void (*handler[LASTEvent])(XEvent *) = {
491 [KeyPress] = kpress, 492 [KeyPress] = kpress,
@@ -4331,14 +4332,19 @@ run(void)
4331void 4332void
4332usage(void) 4333usage(void)
4333{ 4334{
4334 die("%s " VERSION " (c) 2010-2016 st engineers\n" 4335 die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]"
4335 "usage: st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]\n" 4336 " [-o file] [-T title]\n"
4336 " [-i] [-t title] [-T title] [-w windowid] [-e command ...]" 4337 " [-t title] [-w windowid] [[-e] command [args ...]]\n"
4337 " [command ...]\n" 4338 " %s [-aiv] [-c class] [-f font] [-g geometry]"
4338 " st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]\n" 4339 " [-o file] [-T title]\n"
4339 " [-i] [-t title] [-T title] [-w windowid] -l line" 4340 " [-t title] [-w windowid] -l line [stty_args ...]\n",
4340 " [stty_args ...]\n", 4341 argv0, argv0);
4341 argv0); 4342}
4343
4344void
4345version(void)
4346{
4347 die("%s " VERSION " (c) 2010-2016 st engineers\n", argv0);
4342} 4348}
4343 4349
4344int 4350int
@@ -4385,6 +4391,8 @@ main(int argc, char *argv[])
4385 opt_embed = EARGF(usage()); 4391 opt_embed = EARGF(usage());
4386 break; 4392 break;
4387 case 'v': 4393 case 'v':
4394 version();
4395 break;
4388 default: 4396 default:
4389 usage(); 4397 usage();
4390 } ARGEND; 4398 } ARGEND;