Add short aliases for all command-line options
This commit is contained in:
parent
f6cd548aef
commit
71517ec246
4 changed files with 36 additions and 33 deletions
18
README.md
18
README.md
|
|
@ -14,16 +14,16 @@ make
|
|||
./murx --prefix x work # same as -p x
|
||||
./murx -s bottom work # show the session status line at the bottom
|
||||
./murx --status bottom work # same as -s bottom
|
||||
./murx --cwd work # show the current directory in the status bar
|
||||
./murx --murx work # show [murx] on the left of the status bar
|
||||
./murx -d work # --cwd, show the current directory in the status bar
|
||||
./murx -m work # --murx, show [murx] on the left of the status bar
|
||||
./murx -c 191a1c work # use a grey status bar background
|
||||
./murx --history 10000 work # keep up to 10,000 history lines per pane
|
||||
./murx --clock work # show the status bar clock
|
||||
./murx --hostname work # show the hostname: prefix in window titles
|
||||
./murx --titles work # show a title row above each pane
|
||||
./murx -l, --list-sessions # list running sessions without attaching
|
||||
./murx --help # logo, version, usage and shortcuts
|
||||
./murx -v, --version # print the version and exit
|
||||
./murx -H 10000 work # --history, keep up to 10,000 history lines per pane
|
||||
./murx -C work # --clock, show the status bar clock
|
||||
./murx -n work # --hostname, show the hostname: prefix in window titles
|
||||
./murx -t work # --titles, show a title row above each pane
|
||||
./murx -l # --list-sessions, list running sessions without attaching
|
||||
./murx -h # --help, logo, version, usage and shortcuts
|
||||
./murx -v # --version, print the version and exit
|
||||
```
|
||||
|
||||
Detach with `Ctrl-A d`. Run `murx` again to reattach.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
# Unreleased
|
||||
|
||||
- Added short options for `--history` (`-H`), `--cwd` (`-d`),
|
||||
`--clock` (`-C`), `--murx` (`-m`), `--hostname` (`-n`), and
|
||||
`--titles` (`-t`).
|
||||
- Renamed `--pane-titles` to `--titles`.
|
||||
|
||||
# murx 1.0.3 released
|
||||
|
|
|
|||
24
murx.1
24
murx.1
|
|
@ -6,12 +6,12 @@ murx \- small persistent terminal multiplexer
|
|||
.RB [ \-p " letter"]
|
||||
.RB [ \-s " top|bottom"]
|
||||
.RB [ \-c " RRGGBB"]
|
||||
.RB [ \-\-history " lines"]
|
||||
.RB [ \-\-cwd ]
|
||||
.RB [ \-\-clock ]
|
||||
.RB [ \-\-murx ]
|
||||
.RB [ \-\-hostname ]
|
||||
.RB [ \-\-titles ]
|
||||
.RB [ \-H " lines"]
|
||||
.RB [ \-d ]
|
||||
.RB [ \-C ]
|
||||
.RB [ \-m ]
|
||||
.RB [ \-n ]
|
||||
.RB [ \-t ]
|
||||
.RB [ \-\- ]
|
||||
.RI [ session ]
|
||||
.br
|
||||
|
|
@ -46,7 +46,7 @@ hyphens or underscores. Use
|
|||
before a name beginning with a hyphen.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-\-history " lines"
|
||||
.BR \-H ", " \-\-history " lines"
|
||||
Set the maximum number of normal-screen history lines retained per pane
|
||||
in a new session. Accepts 0 to 100,000, with 0 disabling history retention.
|
||||
Reattaching preserves the existing session's limit.
|
||||
|
|
@ -78,21 +78,21 @@ Supply six hexadecimal digits, such as 000000 for black.
|
|||
Omitting this option preserves the session's color when reattaching. New
|
||||
sessions use the terminal's default background unless a color is supplied.
|
||||
.TP
|
||||
.B \-\-cwd
|
||||
.BR \-d ", " \-\-cwd
|
||||
Show the current directory at the left of the status line.
|
||||
.TP
|
||||
.B \-\-clock
|
||||
.BR \-C ", " \-\-clock
|
||||
Show the status clock.
|
||||
.TP
|
||||
.B \-\-murx
|
||||
.BR \-m ", " \-\-murx
|
||||
Show the [murx] label at the left of the status line when
|
||||
.B \-\-cwd
|
||||
is not enabled. The directory takes precedence if both options are supplied.
|
||||
.TP
|
||||
.B \-\-hostname
|
||||
.BR \-n ", " \-\-hostname
|
||||
Show the hostname: prefix in window names and the outer terminal title.
|
||||
.TP
|
||||
.B \-\-titles
|
||||
.BR \-t ", " \-\-titles
|
||||
Show the title row above each pane. Pane titles are off by default.
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
|
|
|
|||
24
murx.c
24
murx.c
|
|
@ -4989,12 +4989,12 @@ static void print_help(FILE *out) {
|
|||
snprintf(history_help, sizeof history_help,
|
||||
"history lines per pane in new sessions (0-%d, default: %d)",
|
||||
MAX_HISTORY_LINES, DEFAULT_HISTORY_LINES);
|
||||
help_row(out, "--history LINES", history_help);
|
||||
help_row(out, "--cwd", "show current directory in status bar");
|
||||
help_row(out, "--clock", "show clock in status bar");
|
||||
help_row(out, "--murx", "show [murx] in status bar unless --cwd is set");
|
||||
help_row(out, "--hostname", "show hostname: prefix in window titles");
|
||||
help_row(out, "--titles", "show the title row above each pane (default: off)");
|
||||
help_row(out, "-H, --history LINES", history_help);
|
||||
help_row(out, "-d, --cwd", "show current directory in status bar");
|
||||
help_row(out, "-C, --clock", "show clock in status bar");
|
||||
help_row(out, "-m, --murx", "show [murx] in status bar unless --cwd is set");
|
||||
help_row(out, "-n, --hostname", "show hostname: prefix in window titles");
|
||||
help_row(out, "-t, --titles", "show the title row above each pane (default: off)");
|
||||
|
||||
fputs("\n"
|
||||
"Without -s or -c, an existing session keeps its position and color.\n"
|
||||
|
|
@ -5076,7 +5076,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
if (strcmp(option, "-l") == 0 || strcmp(option, "--list-sessions") == 0) {
|
||||
list = 1;
|
||||
} else if (strcmp(option, "--history") == 0) {
|
||||
} else if (strcmp(option, "-H") == 0 || strcmp(option, "--history") == 0) {
|
||||
const char *value = argi < argc ? argv[argi] : "";
|
||||
char *end;
|
||||
long lines = strtol(value, &end, 10);
|
||||
|
|
@ -5087,15 +5087,15 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
history_limit = (int)lines;
|
||||
argi++;
|
||||
} else if (strcmp(option, "--cwd") == 0) {
|
||||
} else if (strcmp(option, "-d") == 0 || strcmp(option, "--cwd") == 0) {
|
||||
display.show_cwd = 1;
|
||||
} else if (strcmp(option, "--clock") == 0) {
|
||||
} else if (strcmp(option, "-C") == 0 || strcmp(option, "--clock") == 0) {
|
||||
display.show_clock = 1;
|
||||
} else if (strcmp(option, "--murx") == 0) {
|
||||
} else if (strcmp(option, "-m") == 0 || strcmp(option, "--murx") == 0) {
|
||||
display.show_murx = 1;
|
||||
} else if (strcmp(option, "--hostname") == 0) {
|
||||
} else if (strcmp(option, "-n") == 0 || strcmp(option, "--hostname") == 0) {
|
||||
display.show_hostname = 1;
|
||||
} else if (strcmp(option, "--titles") == 0) {
|
||||
} else if (strcmp(option, "-t") == 0 || strcmp(option, "--titles") == 0) {
|
||||
display.show_pane_titles = 1;
|
||||
} else if (strcmp(option, "-p") == 0 || strcmp(option, "--prefix") == 0) {
|
||||
if (argi >= argc || !parse_prefix(argv[argi], &prefix)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue