Upgrade clap to v3.0.0-beta.4 (#250)
This commit is contained in:
parent
59717fa8d3
commit
53136c2982
|
@ -4,9 +4,9 @@ version = 3
|
|||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.42"
|
||||
version = "1.0.43"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486"
|
||||
checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
|
@ -97,9 +97,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.2.1"
|
||||
version = "1.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||
checksum = "2da1976d75adbe5fbc88130ecd119529cf1cc6a93ae1546d8696ee66f0d21af1"
|
||||
|
||||
[[package]]
|
||||
name = "bitvec"
|
||||
|
@ -132,9 +132,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "3.0.0-beta.2"
|
||||
version = "3.0.0-beta.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142"
|
||||
checksum = "fcd70aa5597dbc42f7217a543f9ef2768b2ef823ba29036072d30e1d88e98406"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"bitflags",
|
||||
|
@ -145,15 +145,14 @@ dependencies = [
|
|||
"strsim",
|
||||
"termcolor",
|
||||
"textwrap",
|
||||
"unicode-width",
|
||||
"vec_map",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "3.0.0-beta.2"
|
||||
version = "3.0.0-beta.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1"
|
||||
checksum = "0b5bb0d655624a0b8770d1c178fb8ffcb1f91cc722cb08f451e3dc72465421ac"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-error",
|
||||
|
@ -164,9 +163,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_generate"
|
||||
version = "3.0.0-beta.2"
|
||||
version = "3.0.0-beta.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adf420f8b687b628d2915ccfd43a660c437a170432e3fbcb66944e8717a0d68f"
|
||||
checksum = "2d9b1abef93569f290952eff3c4a0a92d6767bb5158db095b4dc9a512b1c3643"
|
||||
dependencies = [
|
||||
"clap",
|
||||
]
|
||||
|
@ -303,9 +302,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.98"
|
||||
version = "0.2.99"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
|
||||
checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
|
@ -346,9 +345,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "os_str_bytes"
|
||||
version = "2.4.0"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85"
|
||||
checksum = "6acbef58a60fe69ab50510a55bc8cdd4d6cf2283d27ad338f54cb52747a9cf2d"
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
|
@ -375,9 +374,9 @@ checksum = "57e35a3326b75e49aa85f5dc6ec15b41108cf5aee58eabb1f274dd18b73c2451"
|
|||
|
||||
[[package]]
|
||||
name = "predicates-tree"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "15f553275e5721409451eb85e15fd9a860a6e5ab4496eb215987502b5f5391f2"
|
||||
checksum = "d7dd0fd014130206c9352efbdc92be592751b2b9274dff685348341082c6ea3d"
|
||||
dependencies = [
|
||||
"predicates-core",
|
||||
"treeline",
|
||||
|
@ -473,9 +472,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.2.9"
|
||||
version = "0.2.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee"
|
||||
checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
@ -613,9 +612,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.12.1"
|
||||
version = "0.14.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789"
|
||||
checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"
|
||||
dependencies = [
|
||||
"unicode-width",
|
||||
]
|
||||
|
|
|
@ -13,7 +13,7 @@ categories = ["command-line-utilities", "filesystem"]
|
|||
anyhow = "1.0.32"
|
||||
askama = { version = "0.10.3", default-features = false }
|
||||
bincode = "1.3.1"
|
||||
clap = "3.0.0-beta.2"
|
||||
clap = "=3.0.0-beta.4"
|
||||
dirs-next = "2.0.0"
|
||||
dunce = "1.0.1"
|
||||
glob = "0.3.0"
|
||||
|
@ -32,8 +32,8 @@ assert_cmd = "1.0.1"
|
|||
rstest = "0.11.0"
|
||||
|
||||
[build-dependencies]
|
||||
clap = "3.0.0-beta.2"
|
||||
clap_generate = "3.0.0-beta.2"
|
||||
clap = "=3.0.0-beta.4"
|
||||
clap_generate = "=3.0.0-beta.4"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
17
build.rs
17
build.rs
|
@ -1,4 +1,5 @@
|
|||
use std::env;
|
||||
use std::io;
|
||||
use std::process::Command;
|
||||
|
||||
fn git_version() -> Option<String> {
|
||||
|
@ -17,7 +18,7 @@ fn crate_version() -> String {
|
|||
format!("v{}", env::var("CARGO_PKG_VERSION").unwrap())
|
||||
}
|
||||
|
||||
fn generate_completions() {
|
||||
fn generate_completions() -> io::Result<()> {
|
||||
#[path = "src/app/_app.rs"]
|
||||
mod app;
|
||||
|
||||
|
@ -30,11 +31,13 @@ fn generate_completions() {
|
|||
let bin_name = &env::var("CARGO_PKG_NAME").unwrap();
|
||||
let out_dir = "contrib/completions";
|
||||
|
||||
generate_to::<Bash, _, _>(app, bin_name, out_dir);
|
||||
generate_to::<Elvish, _, _>(app, bin_name, out_dir);
|
||||
generate_to::<Fish, _, _>(app, bin_name, out_dir);
|
||||
generate_to::<PowerShell, _, _>(app, bin_name, out_dir);
|
||||
generate_to::<Zsh, _, _>(app, bin_name, out_dir);
|
||||
generate_to::<Bash, _, _>(app, bin_name, out_dir)?;
|
||||
generate_to::<Elvish, _, _>(app, bin_name, out_dir)?;
|
||||
generate_to::<Fish, _, _>(app, bin_name, out_dir)?;
|
||||
generate_to::<PowerShell, _, _>(app, bin_name, out_dir)?;
|
||||
generate_to::<Zsh, _, _>(app, bin_name, out_dir)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -51,5 +54,5 @@ fn main() {
|
|||
println!("cargo:rerun-if-changed=templates");
|
||||
println!("cargo:rerun-if-changed=tests");
|
||||
|
||||
generate_completions();
|
||||
generate_completions().unwrap();
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@ _zoxide() {
|
|||
|
||||
local context curcontext="$curcontext" state line
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-V[Prints version information]' \
|
||||
'--version[Prints version information]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
":: :_zoxide_commands" \
|
||||
"*::: :->zoxide" \
|
||||
&& ret=0
|
||||
|
@ -30,8 +30,10 @@ _zoxide() {
|
|||
case $line[1] in
|
||||
(add)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
'*::paths:_files -/' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
@ -39,8 +41,10 @@ _arguments "${_arguments_options[@]}" \
|
|||
_arguments "${_arguments_options[@]}" \
|
||||
'--from=[Application to import from]: :(autojump z)' \
|
||||
'--merge[Merge into existing database]' \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
':path:_files' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
@ -49,8 +53,10 @@ _arguments "${_arguments_options[@]}" \
|
|||
'--cmd=[Renames the '\''z'\'' command and corresponding aliases]' \
|
||||
'--hook=[Chooses event upon which an entry is added to the database]: :(none prompt pwd)' \
|
||||
'--no-aliases[Prevents zoxide from defining any commands]' \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
':shell:(bash elvish fish nushell posix powershell xonsh zsh)' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
@ -64,8 +70,10 @@ _arguments "${_arguments_options[@]}" \
|
|||
'(-i --interactive)--list[List all matching directories]' \
|
||||
'(-i --interactive)-s[Print score with results]' \
|
||||
'(-i --interactive)--score[Print score with results]' \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
'*::keywords:' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
@ -73,8 +81,10 @@ _arguments "${_arguments_options[@]}" \
|
|||
_arguments "${_arguments_options[@]}" \
|
||||
'()*-i+[]' \
|
||||
'()*--interactive=[]' \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
'*::paths:_files -/' \
|
||||
&& ret=0
|
||||
;;
|
||||
|
@ -86,47 +96,37 @@ esac
|
|||
(( $+functions[_zoxide_commands] )) ||
|
||||
_zoxide_commands() {
|
||||
local commands; commands=(
|
||||
"add:Add a new directory or increment its rank" \
|
||||
"import:Import entries from another application" \
|
||||
"init:Generate shell configuration" \
|
||||
"query:Search for a directory in the database" \
|
||||
"remove:Remove a directory from the database" \
|
||||
'add:Add a new directory or increment its rank' \
|
||||
'import:Import entries from another application' \
|
||||
'init:Generate shell configuration' \
|
||||
'query:Search for a directory in the database' \
|
||||
'remove:Remove a directory from the database' \
|
||||
)
|
||||
_describe -t commands 'zoxide commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_zoxide__add_commands] )) ||
|
||||
_zoxide__add_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
local commands; commands=()
|
||||
_describe -t commands 'zoxide add commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_zoxide__import_commands] )) ||
|
||||
_zoxide__import_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
local commands; commands=()
|
||||
_describe -t commands 'zoxide import commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_zoxide__init_commands] )) ||
|
||||
_zoxide__init_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
local commands; commands=()
|
||||
_describe -t commands 'zoxide init commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_zoxide__query_commands] )) ||
|
||||
_zoxide__query_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
local commands; commands=()
|
||||
_describe -t commands 'zoxide query commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_zoxide__remove_commands] )) ||
|
||||
_zoxide__remove_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
local commands; commands=()
|
||||
_describe -t commands 'zoxide remove commands' commands "$@"
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ Register-ArgumentCompleter -Native -CommandName 'zoxide' -ScriptBlock {
|
|||
|
||||
$completions = @(switch ($command) {
|
||||
'zoxide' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('add', 'add', [CompletionResultType]::ParameterValue, 'Add a new directory or increment its rank')
|
||||
[CompletionResult]::new('import', 'import', [CompletionResultType]::ParameterValue, 'Import entries from another application')
|
||||
[CompletionResult]::new('init', 'init', [CompletionResultType]::ParameterValue, 'Generate shell configuration')
|
||||
|
@ -32,23 +32,29 @@ Register-ArgumentCompleter -Native -CommandName 'zoxide' -ScriptBlock {
|
|||
break
|
||||
}
|
||||
'zoxide;add' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
break
|
||||
}
|
||||
'zoxide;import' {
|
||||
[CompletionResult]::new('--from', 'from', [CompletionResultType]::ParameterName, 'Application to import from')
|
||||
[CompletionResult]::new('--merge', 'merge', [CompletionResultType]::ParameterName, 'Merge into existing database')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
break
|
||||
}
|
||||
'zoxide;init' {
|
||||
[CompletionResult]::new('--cmd', 'cmd', [CompletionResultType]::ParameterName, 'Renames the ''z'' command and corresponding aliases')
|
||||
[CompletionResult]::new('--hook', 'hook', [CompletionResultType]::ParameterName, 'Chooses event upon which an entry is added to the database')
|
||||
[CompletionResult]::new('--no-aliases', 'no-aliases', [CompletionResultType]::ParameterName, 'Prevents zoxide from defining any commands')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
break
|
||||
}
|
||||
'zoxide;query' {
|
||||
|
@ -60,15 +66,19 @@ Register-ArgumentCompleter -Native -CommandName 'zoxide' -ScriptBlock {
|
|||
[CompletionResult]::new('--list', 'list', [CompletionResultType]::ParameterName, 'List all matching directories')
|
||||
[CompletionResult]::new('-s', 's', [CompletionResultType]::ParameterName, 'Print score with results')
|
||||
[CompletionResult]::new('--score', 'score', [CompletionResultType]::ParameterName, 'Print score with results')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
break
|
||||
}
|
||||
'zoxide;remove' {
|
||||
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'i')
|
||||
[CompletionResult]::new('--interactive', 'interactive', [CompletionResultType]::ParameterName, 'interactive')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
break
|
||||
}
|
||||
})
|
||||
|
|
|
@ -51,7 +51,7 @@ _zoxide() {
|
|||
;;
|
||||
|
||||
zoxide__add)
|
||||
opts=" -h --help <paths>... "
|
||||
opts=" -h -V --help --version <PATHS>... "
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -66,7 +66,7 @@ _zoxide() {
|
|||
return 0
|
||||
;;
|
||||
zoxide__import)
|
||||
opts=" -h --from --merge --help <path> "
|
||||
opts=" -h -V --from --merge --help --version <PATH> "
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -85,7 +85,7 @@ _zoxide() {
|
|||
return 0
|
||||
;;
|
||||
zoxide__init)
|
||||
opts=" -h --no-aliases --cmd --hook --help <shell> "
|
||||
opts=" -h -V --no-aliases --cmd --hook --help --version <SHELL> "
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -108,7 +108,7 @@ _zoxide() {
|
|||
return 0
|
||||
;;
|
||||
zoxide__query)
|
||||
opts=" -i -l -s -h --all --interactive --list --score --exclude --help <keywords>... "
|
||||
opts=" -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
|
||||
|
@ -127,7 +127,7 @@ _zoxide() {
|
|||
return 0
|
||||
;;
|
||||
zoxide__remove)
|
||||
opts=" -i -h --interactive --help <paths>... "
|
||||
opts=" -i -h -V --interactive --help --version <PATHS>... "
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
@ -138,7 +138,7 @@ _zoxide() {
|
|||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
-i)
|
||||
-i)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
;;
|
||||
|
|
|
@ -1,24 +1,27 @@
|
|||
|
||||
use builtin;
|
||||
use str;
|
||||
|
||||
edit:completion:arg-completer[zoxide] = [@words]{
|
||||
fn spaces [n]{
|
||||
repeat $n ' ' | joins ''
|
||||
builtin:repeat $n ' ' | str:join ''
|
||||
}
|
||||
fn cand [text desc]{
|
||||
edit:complex-candidate $text &display-suffix=' '(spaces (- 14 (wcswidth $text)))$desc
|
||||
}
|
||||
command = 'zoxide'
|
||||
for word $words[1:-1] {
|
||||
if (has-prefix $word '-') {
|
||||
for word $words[1..-1] {
|
||||
if (str:has-prefix $word '-') {
|
||||
break
|
||||
}
|
||||
command = $command';'$word
|
||||
}
|
||||
completions = [
|
||||
&'zoxide'= {
|
||||
cand -h 'Prints help information'
|
||||
cand --help 'Prints help information'
|
||||
cand -V 'Prints version information'
|
||||
cand --version 'Prints version information'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand add 'Add a new directory or increment its rank'
|
||||
cand import 'Import entries from another application'
|
||||
cand init 'Generate shell configuration'
|
||||
|
@ -26,21 +29,27 @@ edit:completion:arg-completer[zoxide] = [@words]{
|
|||
cand remove 'Remove a directory from the database'
|
||||
}
|
||||
&'zoxide;add'= {
|
||||
cand -h 'Prints help information'
|
||||
cand --help 'Prints help information'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
}
|
||||
&'zoxide;import'= {
|
||||
cand --from 'Application to import from'
|
||||
cand --merge 'Merge into existing database'
|
||||
cand -h 'Prints help information'
|
||||
cand --help 'Prints help information'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
}
|
||||
&'zoxide;init'= {
|
||||
cand --cmd 'Renames the ''z'' command and corresponding aliases'
|
||||
cand --hook 'Chooses event upon which an entry is added to the database'
|
||||
cand --no-aliases 'Prevents zoxide from defining any commands'
|
||||
cand -h 'Prints help information'
|
||||
cand --help 'Prints help information'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
}
|
||||
&'zoxide;query'= {
|
||||
cand --exclude 'Exclude a path from results'
|
||||
|
@ -51,14 +60,18 @@ edit:completion:arg-completer[zoxide] = [@words]{
|
|||
cand --list 'List all matching directories'
|
||||
cand -s 'Print score with results'
|
||||
cand --score 'Print score with results'
|
||||
cand -h 'Prints help information'
|
||||
cand --help 'Prints help information'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
}
|
||||
&'zoxide;remove'= {
|
||||
cand -i 'i'
|
||||
cand --interactive 'interactive'
|
||||
cand -h 'Prints help information'
|
||||
cand --help 'Prints help information'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
}
|
||||
]
|
||||
$completions[$command]
|
||||
|
|
|
@ -1,28 +1,33 @@
|
|||
complete -c zoxide -n "__fish_use_subcommand" -s h -l help -d 'Prints help information'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -s V -l version -d 'Prints version information'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -s h -l help -d 'Print help information'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -s V -l version -d 'Print version information'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -f -a "add" -d 'Add a new directory or increment its rank'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -f -a "import" -d 'Import entries from another application'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -f -a "init" -d 'Generate shell configuration'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -f -a "query" -d 'Search for a directory in the database'
|
||||
complete -c zoxide -n "__fish_use_subcommand" -f -a "remove" -d 'Remove a directory from the database'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from add" -r -f -a "(__fish_complete_directories)"
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from add" -s h -l help -d 'Prints help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from add" -s h -l help -d 'Print help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from add" -s V -l version -d 'Print version information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from import" -r -F
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from import" -l from -d 'Application to import from' -r -f -a "autojump z"
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from import" -l merge -d 'Merge into existing database'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from import" -s h -l help -d 'Prints help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from import" -s h -l help -d 'Print help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from import" -s V -l version -d 'Print version information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from init" -r -f -a "bash elvish fish nushell posix powershell xonsh zsh"
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from init" -l cmd -d 'Renames the \'z\' command and corresponding aliases' -r
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from init" -l hook -d 'Chooses event upon which an entry is added to the database' -r -f -a "none prompt pwd"
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from init" -l no-aliases -d 'Prevents zoxide from defining any commands'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from init" -s h -l help -d 'Prints help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from init" -s h -l help -d 'Print help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from init" -s V -l version -d 'Print version information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from query" -r
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from query" -l exclude -d 'Exclude a path from results' -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 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'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from query" -s h -l help -d 'Prints help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from query" -s h -l help -d 'Print help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from query" -s V -l version -d 'Print version information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from remove" -s i -l interactive -r
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from remove" -r -f -a "(__fish_complete_directories)"
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from remove" -s h -l help -d 'Prints help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from remove" -s h -l help -d 'Print help information'
|
||||
complete -c zoxide -n "__fish_seen_subcommand_from remove" -s V -l version -d 'Print version information'
|
||||
|
|
|
@ -18,8 +18,8 @@ const ENV_HELP: &str = "ENVIRONMENT VARIABLES:
|
|||
after_help = ENV_HELP,
|
||||
global_setting(AppSettings::ColoredHelp),
|
||||
global_setting(AppSettings::DisableHelpSubcommand),
|
||||
global_setting(AppSettings::GlobalVersion),
|
||||
global_setting(AppSettings::VersionlessSubcommands),
|
||||
global_setting(AppSettings::DisableVersionForSubcommands),
|
||||
global_setting(AppSettings::PropagateVersion),
|
||||
version = option_env!("ZOXIDE_VERSION").unwrap_or_default()
|
||||
)]
|
||||
pub enum App {
|
||||
|
|
Loading…
Reference in New Issue