applied parts of Connor Lane Smith's cleanup patch.

master
Aurélien Aptel 14 years ago
parent 5beae6a62e
commit 7d352f1436

26
st.1

@ -1,4 +1,4 @@
.TH ST 1 st-VERSION .TH ST 1 st\-VERSION
.SH NAME .SH NAME
st \- simple terminal st \- simple terminal
.SH SYNOPSIS .SH SYNOPSIS
@ -9,24 +9,24 @@ st \- simple terminal
.IR title ] .IR title ]
.RB [ \-v ] .RB [ \-v ]
.RB [ \-e .RB [ \-e
.IR cmd ] .IR command ...]
.SH DESCRIPTION .SH DESCRIPTION
.B st .B st
is a simple terminal emulator. is a simple terminal emulator.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-t title .BI \-t " title"
Overrides the default title (st) defines the window title (default 'st').
.TP .TP
.B \-c class .BI \-c " class"
Overrides the default class ($TERM) defines the window class (default $TERM).
.TP .TP
.B \-v .B \-v
Prints version information to standard output, then exits. prints version information to stderr, then exits.
.TP .TP
.B \-e cmd [arguments] .BI \-e " program " [ " arguments " "... ]"
Execute cmd instead of the shell. Type your command as you would on your st executes
shell. If this option is used, it .I program
.BI "must be the last" instead of the shell. If this is used it
on the command-line. This is the same behaviour as xterm/rxvt. .B must be the last option
on the command line, as in xterm / rxvt.

14
st.c

@ -34,8 +34,8 @@
#endif #endif
#define USAGE \ #define USAGE \
"st-" VERSION ", (c) 2010 st engineers\n" \ "st-" VERSION ", (c) 2010-2011 st engineers\n" \
"usage: st [-t title] [-c class] [-v] [-e cmd]\n" "usage: st [-t title] [-c class] [-v] [-e command...]\n"
/* Arbitrary sizes */ /* Arbitrary sizes */
#define ESC_TITLE_SIZ 256 #define ESC_TITLE_SIZ 256
@ -1907,17 +1907,17 @@ main(int argc, char *argv[]) {
case 'c': case 'c':
if(++i < argc) opt_class = argv[i]; if(++i < argc) opt_class = argv[i];
break; break;
case 'e': case 'e':
/* eat every remaining arguments */
if(++i < argc) opt_cmd = &argv[i]; if(++i < argc) opt_cmd = &argv[i];
break; goto run;
case 'v': case 'v':
default: default:
die(USAGE); die(USAGE);
} }
/* -e eats every remaining arguments */
if(opt_cmd)
break;
} }
run:
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
tnew(80, 24); tnew(80, 24);
ttynew(); ttynew();

Loading…
Cancel
Save