From 153e06004334ddcc62ba948db3ca5ec397ef814f Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 9 May 2023 00:51:26 +0530 Subject: [PATCH] Add short option -a for --all --- CHANGELOG.md | 6 ++++++ contrib/completions/_zoxide | 3 ++- contrib/completions/_zoxide.ps1 | 3 ++- contrib/completions/zoxide.bash | 2 +- contrib/completions/zoxide.elv | 3 ++- contrib/completions/zoxide.fish | 2 +- contrib/completions/zoxide.ts | 4 ++-- src/cmd/cmd.rs | 4 ++-- 8 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83e8681..4eae81b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Short option `-a` for `zoxide query --all`. + ## [0.9.1] - 2023-05-07 ### Added diff --git a/contrib/completions/_zoxide b/contrib/completions/_zoxide index abbec76..fd898e6 100644 --- a/contrib/completions/_zoxide +++ b/contrib/completions/_zoxide @@ -118,7 +118,8 @@ _arguments "${_arguments_options[@]}" \ (query) _arguments "${_arguments_options[@]}" \ '--exclude=[Exclude the current directory]:path:_files -/' \ -'--all[Show deleted directories]' \ +'-a[Show unavailable directories]' \ +'--all[Show unavailable directories]' \ '(-l --list)-i[Use interactive selection]' \ '(-l --list)--interactive[Use interactive selection]' \ '(-i --interactive)-l[List all matching directories]' \ diff --git a/contrib/completions/_zoxide.ps1 b/contrib/completions/_zoxide.ps1 index 994ebc0..3ab5c02 100644 --- a/contrib/completions/_zoxide.ps1 +++ b/contrib/completions/_zoxide.ps1 @@ -100,7 +100,8 @@ Register-ArgumentCompleter -Native -CommandName 'zoxide' -ScriptBlock { } 'zoxide;query' { [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'Exclude the current directory') - [CompletionResult]::new('--all', 'all', [CompletionResultType]::ParameterName, 'Show deleted directories') + [CompletionResult]::new('-a', 'a', [CompletionResultType]::ParameterName, 'Show unavailable directories') + [CompletionResult]::new('--all', 'all', [CompletionResultType]::ParameterName, 'Show unavailable directories') [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Use interactive selection') [CompletionResult]::new('--interactive', 'interactive', [CompletionResultType]::ParameterName, 'Use interactive selection') [CompletionResult]::new('-l', 'l', [CompletionResultType]::ParameterName, 'List all matching directories') diff --git a/contrib/completions/zoxide.bash b/contrib/completions/zoxide.bash index 04ccbd0..93c19d9 100644 --- a/contrib/completions/zoxide.bash +++ b/contrib/completions/zoxide.bash @@ -187,7 +187,7 @@ _zoxide() { return 0 ;; zoxide__query) - opts="-i -l -s -h -V --all --interactive --list --score --exclude --help --version [KEYWORDS]..." + opts="-a -i -l -s -h -V --all --interactive --list --score --exclude --help --version [KEYWORDS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 diff --git a/contrib/completions/zoxide.elv b/contrib/completions/zoxide.elv index dc79e0d..6183d37 100644 --- a/contrib/completions/zoxide.elv +++ b/contrib/completions/zoxide.elv @@ -88,7 +88,8 @@ set edit:completion:arg-completer[zoxide] = {|@words| } &'zoxide;query'= { cand --exclude 'Exclude the current directory' - cand --all 'Show deleted directories' + cand -a 'Show unavailable directories' + cand --all 'Show unavailable directories' cand -i 'Use interactive selection' cand --interactive 'Use interactive selection' cand -l 'List all matching directories' diff --git a/contrib/completions/zoxide.fish b/contrib/completions/zoxide.fish index c6a5b20..276cbaf 100644 --- a/contrib/completions/zoxide.fish +++ b/contrib/completions/zoxide.fish @@ -32,7 +32,7 @@ complete -c zoxide -n "__fish_seen_subcommand_from init" -l no-cmd -d 'Prevents complete -c zoxide -n "__fish_seen_subcommand_from init" -s h -l help -d 'Print help' complete -c zoxide -n "__fish_seen_subcommand_from init" -s V -l version -d 'Print version' complete -c zoxide -n "__fish_seen_subcommand_from query" -l exclude -d 'Exclude the current directory' -r -f -a "(__fish_complete_directories)" -complete -c zoxide -n "__fish_seen_subcommand_from query" -l all -d 'Show deleted directories' +complete -c zoxide -n "__fish_seen_subcommand_from query" -s a -l all -d 'Show unavailable directories' complete -c zoxide -n "__fish_seen_subcommand_from query" -s i -l interactive -d 'Use interactive selection' complete -c zoxide -n "__fish_seen_subcommand_from query" -s l -l list -d 'List all matching directories' complete -c zoxide -n "__fish_seen_subcommand_from query" -s s -l score -d 'Print score with results' diff --git a/contrib/completions/zoxide.ts b/contrib/completions/zoxide.ts index 4bfb0c2..0200591 100644 --- a/contrib/completions/zoxide.ts +++ b/contrib/completions/zoxide.ts @@ -205,8 +205,8 @@ const completion: Fig.Spec = { }, }, { - name: "--all", - description: "Show deleted directories", + name: ["-a", "--all"], + description: "Show unavailable directories", }, { name: ["-i", "--interactive"], diff --git a/src/cmd/cmd.rs b/src/cmd/cmd.rs index 9a572b4..5a78a83 100644 --- a/src/cmd/cmd.rs +++ b/src/cmd/cmd.rs @@ -150,8 +150,8 @@ pub enum InitShell { pub struct Query { pub keywords: Vec, - /// Show deleted directories - #[clap(long)] + /// Show unavailable directories + #[clap(long, short)] pub all: bool, /// Use interactive selection