From beb29e8ff7f9cc5dc323e8cd95178a37562b5356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Gro=C3=9F?= Date: Mon, 6 Nov 2023 00:53:17 +0100 Subject: [PATCH] Mention the -e aliases explicitly in the help Otherwise it is just hidden forever. We can't use the proper declarative interface, because we are faking quite some stuff for "-e", so instead we mention it explicitly in the help output. --- assets/shell-completion/fish | 4 ++-- assets/shell-completion/zsh | 6 +++--- docs/examples/cmd-synopsis-wezterm--help.txt | 2 +- docs/examples/cmd-synopsis-wezterm-start--help.txt | 4 ++-- wezterm-gui-subcommands/src/lib.rs | 2 +- wezterm-gui/src/main.rs | 2 +- wezterm/src/main.rs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/assets/shell-completion/fish b/assets/shell-completion/fish index c9a74c6ce11..440af2b38fa 100644 --- a/assets/shell-completion/fish +++ b/assets/shell-completion/fish @@ -3,7 +3,7 @@ complete -c wezterm -n "__fish_use_subcommand" -l config -d 'Override specific c complete -c wezterm -n "__fish_use_subcommand" -s n -l skip-config -d 'Skip loading wezterm.lua' complete -c wezterm -n "__fish_use_subcommand" -s h -l help -d 'Print help' complete -c wezterm -n "__fish_use_subcommand" -s V -l version -d 'Print version' -complete -c wezterm -n "__fish_use_subcommand" -f -a "start" -d 'Start the GUI, optionally running an alternative program' +complete -c wezterm -n "__fish_use_subcommand" -f -a "start" -d 'Start the GUI, optionally running an alternative program [aliases: -e]' complete -c wezterm -n "__fish_use_subcommand" -f -a "ssh" -d 'Establish an ssh session' complete -c wezterm -n "__fish_use_subcommand" -f -a "serial" -d 'Open a serial port' complete -c wezterm -n "__fish_use_subcommand" -f -a "connect" -d 'Connect to wezterm multiplexer' @@ -191,7 +191,7 @@ complete -c wezterm -n "__fish_seen_subcommand_from replay" -l cat -d 'Just emit complete -c wezterm -n "__fish_seen_subcommand_from replay" -s h -l help -d 'Print help' complete -c wezterm -n "__fish_seen_subcommand_from shell-completion" -l shell -d 'Which shell to generate for' -r -f -a "{bash '',elvish '',fish '',power-shell '',zsh '',fig ''}" complete -c wezterm -n "__fish_seen_subcommand_from shell-completion" -s h -l help -d 'Print help' -complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "start" -d 'Start the GUI, optionally running an alternative program' +complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "start" -d 'Start the GUI, optionally running an alternative program [aliases: -e]' complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "ssh" -d 'Establish an ssh session' complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "serial" -d 'Open a serial port' complete -c wezterm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from start; and not __fish_seen_subcommand_from ssh; and not __fish_seen_subcommand_from serial; and not __fish_seen_subcommand_from connect; and not __fish_seen_subcommand_from ls-fonts; and not __fish_seen_subcommand_from show-keys; and not __fish_seen_subcommand_from cli; and not __fish_seen_subcommand_from imgcat; and not __fish_seen_subcommand_from set-working-directory; and not __fish_seen_subcommand_from record; and not __fish_seen_subcommand_from replay; and not __fish_seen_subcommand_from shell-completion; and not __fish_seen_subcommand_from help" -f -a "connect" -d 'Connect to wezterm multiplexer' diff --git a/assets/shell-completion/zsh b/assets/shell-completion/zsh index 7ff90146fab..db7569a2e78 100644 --- a/assets/shell-completion/zsh +++ b/assets/shell-completion/zsh @@ -46,7 +46,7 @@ _arguments "${_arguments_options[@]}" \ '--attach[When used with --domain, if the domain already has running panes, wezterm will simply attach and will NOT spawn the specified PROG. If you omit --attach when using --domain, wezterm will attach AND then spawn PROG]' \ '-h[Print help (see more with '\''--help'\'')]' \ '--help[Print help (see more with '\''--help'\'')]' \ -'*::prog -- Instead of executing your shell, run PROG. For example\: `wezterm start -- bash -l` will spawn bash as if it were a login shell:_cmdambivalent' \ +'*::prog -- Instead of executing your shell, run PROG. For example\: `wezterm start -- bash -l` will spawn bash as if it were a login shell. \[aliases\: -e\]:_cmdambivalent' \ && ret=0 ;; (ssh) @@ -611,7 +611,7 @@ esac (( $+functions[_wezterm_commands] )) || _wezterm_commands() { local commands; commands=( -'start:Start the GUI, optionally running an alternative program' \ +'start:Start the GUI, optionally running an alternative program \[aliases\: -e\]' \ 'ssh:Establish an ssh session' \ 'serial:Open a serial port' \ 'connect:Connect to wezterm multiplexer' \ @@ -818,7 +818,7 @@ _wezterm__cli__help__help_commands() { (( $+functions[_wezterm__help_commands] )) || _wezterm__help_commands() { local commands; commands=( -'start:Start the GUI, optionally running an alternative program' \ +'start:Start the GUI, optionally running an alternative program \[aliases\: -e\]' \ 'ssh:Establish an ssh session' \ 'serial:Open a serial port' \ 'connect:Connect to wezterm multiplexer' \ diff --git a/docs/examples/cmd-synopsis-wezterm--help.txt b/docs/examples/cmd-synopsis-wezterm--help.txt index 121e9181e42..190b7704949 100644 --- a/docs/examples/cmd-synopsis-wezterm--help.txt +++ b/docs/examples/cmd-synopsis-wezterm--help.txt @@ -5,7 +5,7 @@ Usage: wezterm [OPTIONS] [COMMAND] Commands: start Start the GUI, optionally running an alternative - program + program [aliases: -e] ssh Establish an ssh session serial Open a serial port connect Connect to wezterm multiplexer diff --git a/docs/examples/cmd-synopsis-wezterm-start--help.txt b/docs/examples/cmd-synopsis-wezterm-start--help.txt index 12d01fde52a..d314206c1cd 100644 --- a/docs/examples/cmd-synopsis-wezterm-start--help.txt +++ b/docs/examples/cmd-synopsis-wezterm-start--help.txt @@ -1,11 +1,11 @@ -Start the GUI, optionally running an alternative program +Start the GUI, optionally running an alternative program [aliases: -e] Usage: wezterm start [OPTIONS] [PROG]... Arguments: [PROG]... Instead of executing your shell, run PROG. For example: `wezterm start - -- bash -l` will spawn bash as if it were a login shell + -- bash -l` will spawn bash as if it were a login shell. [aliases: -e] Options: --no-auto-connect diff --git a/wezterm-gui-subcommands/src/lib.rs b/wezterm-gui-subcommands/src/lib.rs index c64f2b31479..da42ac66ccc 100644 --- a/wezterm-gui-subcommands/src/lib.rs +++ b/wezterm-gui-subcommands/src/lib.rs @@ -103,7 +103,7 @@ pub struct StartCommand { /// Instead of executing your shell, run PROG. /// For example: `wezterm start -- bash -l` will spawn bash - /// as if it were a login shell. + /// as if it were a login shell. [aliases: -e] #[arg(value_parser, value_hint=ValueHint::CommandWithArguments, num_args=1..)] pub prog: Vec, } diff --git a/wezterm-gui/src/main.rs b/wezterm-gui/src/main.rs index 6d86005e659..9d2945577c3 100644 --- a/wezterm-gui/src/main.rs +++ b/wezterm-gui/src/main.rs @@ -106,7 +106,7 @@ struct Opt { enum SubCommand { #[command( name = "start", - about = "Start the GUI, optionally running an alternative program" + about = "Start the GUI, optionally running an alternative program [aliases: -e]" )] Start(StartCommand), diff --git a/wezterm/src/main.rs b/wezterm/src/main.rs index a8cc8f1c4b3..282ed572fac 100644 --- a/wezterm/src/main.rs +++ b/wezterm/src/main.rs @@ -91,7 +91,7 @@ impl CompletionGenerator for Shell { enum SubCommand { #[command( name = "start", - about = "Start the GUI, optionally running an alternative program" + about = "Start the GUI, optionally running an alternative program [aliases: -e]" )] Start(StartCommand),