aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2011-05-14 17:47:37 +0200
committerAurélien Aptel <aurelien.aptel@gmail.com>2011-05-14 17:47:37 +0200
commitcdd993c39ee72c426a6f02475928c0f03dc5a71d (patch)
treef2922a25996f343571e2fc6cfbb3a34ab0b9f72e
parenta7f4af0139d6c0890007c7349b59ef94266ccea9 (diff)
downloadst-patched-cdd993c39ee72c426a6f02475928c0f03dc5a71d.tar.bz2
st-patched-cdd993c39ee72c426a6f02475928c0f03dc5a71d.tar.xz
st-patched-cdd993c39ee72c426a6f02475928c0f03dc5a71d.zip
applied parts of Connor Lane Smith's cleanup patch.
-rw-r--r--st.126
-rw-r--r--st.c14
2 files changed, 20 insertions, 20 deletions
diff --git a/st.1 b/st.1
index f1f41a7..69cfe86 100644
--- a/st.1
+++ b/st.1
@@ -1,4 +1,4 @@
1.TH ST 1 st-VERSION 1.TH ST 1 st\-VERSION
2.SH NAME 2.SH NAME
3st \- simple terminal 3st \- simple terminal
4.SH SYNOPSIS 4.SH SYNOPSIS
@@ -9,24 +9,24 @@ st \- simple terminal
9.IR title ] 9.IR title ]
10.RB [ \-v ] 10.RB [ \-v ]
11.RB [ \-e 11.RB [ \-e
12.IR cmd ] 12.IR command ...]
13.SH DESCRIPTION 13.SH DESCRIPTION
14.B st 14.B st
15is a simple terminal emulator. 15is a simple terminal emulator.
16.SH OPTIONS 16.SH OPTIONS
17.TP 17.TP
18.B \-t title 18.BI \-t " title"
19Overrides the default title (st) 19defines the window title (default 'st').
20.TP 20.TP
21.B \-c class 21.BI \-c " class"
22Overrides the default class ($TERM) 22defines the window class (default $TERM).
23.TP 23.TP
24.B \-v 24.B \-v
25Prints version information to standard output, then exits. 25prints version information to stderr, then exits.
26.TP 26.TP
27.B \-e cmd [arguments] 27.BI \-e " program " [ " arguments " "... ]"
28Execute cmd instead of the shell. Type your command as you would on your 28st executes
29shell. If this option is used, it 29.I program
30.BI "must be the last" 30instead of the shell. If this is used it
31on the command-line. This is the same behaviour as xterm/rxvt. 31.B must be the last option
32 32on the command line, as in xterm / rxvt.
diff --git a/st.c b/st.c
index 8347dbe..01ffa21 100644
--- a/st.c
+++ b/st.c
@@ -34,8 +34,8 @@
34#endif 34#endif
35 35
36#define USAGE \ 36#define USAGE \
37 "st-" VERSION ", (c) 2010 st engineers\n" \ 37 "st-" VERSION ", (c) 2010-2011 st engineers\n" \
38 "usage: st [-t title] [-c class] [-v] [-e cmd]\n" 38 "usage: st [-t title] [-c class] [-v] [-e command...]\n"
39 39
40/* Arbitrary sizes */ 40/* Arbitrary sizes */
41#define ESC_TITLE_SIZ 256 41#define ESC_TITLE_SIZ 256
@@ -1907,17 +1907,17 @@ main(int argc, char *argv[]) {
1907 case 'c': 1907 case 'c':
1908 if(++i < argc) opt_class = argv[i]; 1908 if(++i < argc) opt_class = argv[i];
1909 break; 1909 break;
1910 case 'e': 1910 case 'e':
1911 /* eat every remaining arguments */
1911 if(++i < argc) opt_cmd = &argv[i]; 1912 if(++i < argc) opt_cmd = &argv[i];
1912 break; 1913 goto run;
1913 case 'v': 1914 case 'v':
1914 default: 1915 default:
1915 die(USAGE); 1916 die(USAGE);
1916 } 1917 }
1917 /* -e eats every remaining arguments */
1918 if(opt_cmd)
1919 break;
1920 } 1918 }
1919
1920 run:
1921 setlocale(LC_CTYPE, ""); 1921 setlocale(LC_CTYPE, "");
1922 tnew(80, 24); 1922 tnew(80, 24);
1923 ttynew(); 1923 ttynew();