From 5b17550eb173861178a401bd551f72d57689cfe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sat, 20 Apr 2024 22:26:10 +1200 Subject: [PATCH] Remove -k --- completions/bash | 2 +- completions/elvish | 2 -- completions/fish | 1 - completions/nu | 1 - completions/powershell | 2 -- completions/zsh | 2 -- crates/cli/src/args.rs | 8 -------- 7 files changed, 1 insertion(+), 17 deletions(-) diff --git a/completions/bash b/completions/bash index 6c73319d..ccd16ef8 100644 --- a/completions/bash +++ b/completions/bash @@ -19,7 +19,7 @@ _watchexec() { case "${cmd}" in watchexec) - opts="-w -c -o -r -s -k -d -p -n -E -1 -N -q -e -f -j -i -v -h -V --watch --clear --on-busy-update --restart --signal --kill --stop-signal --stop-timeout --map-signal --debounce --stdin-quit --no-vcs-ignore --no-project-ignore --no-global-ignore --no-default-ignore --no-discover-ignore --ignore-nothing --postpone --delay-run --poll --shell --no-environment --emit-events-to --only-emit-events --env --no-process-group --notify --color --timings --quiet --bell --project-origin --workdir --exts --filter --filter-file --filter-prog --ignore --ignore-file --fs-events --no-meta --print-events --verbose --log-file --manual --completions --help --version [COMMAND]..." + opts="-w -c -o -r -s -d -p -n -E -1 -N -q -e -f -j -i -v -h -V --watch --clear --on-busy-update --restart --signal --stop-signal --stop-timeout --map-signal --debounce --stdin-quit --no-vcs-ignore --no-project-ignore --no-global-ignore --no-default-ignore --no-discover-ignore --ignore-nothing --postpone --delay-run --poll --shell --no-environment --emit-events-to --only-emit-events --env --no-process-group --notify --color --timings --quiet --bell --project-origin --workdir --exts --filter --filter-file --filter-prog --ignore --ignore-file --fs-events --no-meta --print-events --verbose --log-file --manual --completions --help --version [COMMAND]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 diff --git a/completions/elvish b/completions/elvish index 4faa17b9..feffd1e7 100644 --- a/completions/elvish +++ b/completions/elvish @@ -55,8 +55,6 @@ set edit:completion:arg-completer[watchexec] = {|@words| cand --completions 'Generate a shell completions script' cand -r 'Restart the process if it''s still running' cand --restart 'Restart the process if it''s still running' - cand -k 'Hidden legacy shorthand for ''--signal=kill''' - cand --kill 'Hidden legacy shorthand for ''--signal=kill''' cand --stdin-quit 'Exit when stdin closes' cand --no-vcs-ignore 'Don''t load gitignores' cand --no-project-ignore 'Don''t load project-local ignores' diff --git a/completions/fish b/completions/fish index 81fc2504..3a6a01fa 100644 --- a/completions/fish +++ b/completions/fish @@ -24,7 +24,6 @@ complete -c watchexec -l fs-events -d 'Filesystem events to filter to' -r -f -a complete -c watchexec -l log-file -d 'Write diagnostic logs to a file' -r -F complete -c watchexec -l completions -d 'Generate a shell completions script' -r -f -a "{bash '',elvish '',fish '',nu '',powershell '',zsh ''}" complete -c watchexec -s r -l restart -d 'Restart the process if it\'s still running' -complete -c watchexec -s k -l kill -d 'Hidden legacy shorthand for \'--signal=kill\'' complete -c watchexec -l stdin-quit -d 'Exit when stdin closes' complete -c watchexec -l no-vcs-ignore -d 'Don\'t load gitignores' complete -c watchexec -l no-project-ignore -d 'Don\'t load project-local ignores' diff --git a/completions/nu b/completions/nu index 6c577cea..67444385 100644 --- a/completions/nu +++ b/completions/nu @@ -32,7 +32,6 @@ module completions { --on-busy-update(-o): string@"nu-complete watchexec on_busy_update" # What to do when receiving events while the command is running --restart(-r) # Restart the process if it's still running --signal(-s): string # Send a signal to the process when it's still running - --kill(-k) # Hidden legacy shorthand for '--signal=kill' --stop-signal: string # Signal to send to stop the command --stop-timeout: string # Time to wait for the command to exit gracefully --map-signal: string # Translate signals from the OS to signals to send to the command diff --git a/completions/powershell b/completions/powershell index 330890c6..553cd03e 100644 --- a/completions/powershell +++ b/completions/powershell @@ -58,8 +58,6 @@ Register-ArgumentCompleter -Native -CommandName 'watchexec' -ScriptBlock { [CompletionResult]::new('--completions', 'completions', [CompletionResultType]::ParameterName, 'Generate a shell completions script') [CompletionResult]::new('-r', 'r', [CompletionResultType]::ParameterName, 'Restart the process if it''s still running') [CompletionResult]::new('--restart', 'restart', [CompletionResultType]::ParameterName, 'Restart the process if it''s still running') - [CompletionResult]::new('-k', 'k', [CompletionResultType]::ParameterName, 'Hidden legacy shorthand for ''--signal=kill''') - [CompletionResult]::new('--kill', 'kill', [CompletionResultType]::ParameterName, 'Hidden legacy shorthand for ''--signal=kill''') [CompletionResult]::new('--stdin-quit', 'stdin-quit', [CompletionResultType]::ParameterName, 'Exit when stdin closes') [CompletionResult]::new('--no-vcs-ignore', 'no-vcs-ignore', [CompletionResultType]::ParameterName, 'Don''t load gitignores') [CompletionResult]::new('--no-project-ignore', 'no-project-ignore', [CompletionResultType]::ParameterName, 'Don''t load project-local ignores') diff --git a/completions/zsh b/completions/zsh index 71be820a..1afdc507 100644 --- a/completions/zsh +++ b/completions/zsh @@ -52,8 +52,6 @@ _watchexec() { '(--manual)--completions=[Generate a shell completions script]:COMPLETIONS:(bash elvish fish nu powershell zsh)' \ '(-o --on-busy-update)-r[Restart the process if it'\''s still running]' \ '(-o --on-busy-update)--restart[Restart the process if it'\''s still running]' \ -'-k[Hidden legacy shorthand for '\''--signal=kill'\'']' \ -'--kill[Hidden legacy shorthand for '\''--signal=kill'\'']' \ '--stdin-quit[Exit when stdin closes]' \ '--no-vcs-ignore[Don'\''t load gitignores]' \ '--no-project-ignore[Don'\''t load project-local ignores]' \ diff --git a/crates/cli/src/args.rs b/crates/cli/src/args.rs index 93af4de9..6061c0f4 100644 --- a/crates/cli/src/args.rs +++ b/crates/cli/src/args.rs @@ -193,10 +193,6 @@ pub struct Args { )] pub signal: Option, - /// Hidden legacy shorthand for '--signal=kill'. - #[arg(short, long, hide = true)] - pub kill: bool, - /// Signal to send to stop the command /// /// This is used by 'restart' and 'signal' modes of '--on-busy-update' (unless '--signal' is @@ -1172,10 +1168,6 @@ pub async fn get_args() -> Result { args.no_discover_ignore = true; } - if args.kill { - args.signal = Some(Signal::ForceStop); - } - if args.signal.is_some() { args.on_busy_update = OnBusyUpdate::Signal; } else if args.restart {