mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 23:46:41 +02:00
fix: Update build.rs to fix completions
This commit is contained in:
parent
4998bd398b
commit
57097d3bec
3 changed files with 9 additions and 13 deletions
8
build.rs
8
build.rs
|
@ -11,8 +11,8 @@ fn main() {
|
||||||
let name = app.get_name().to_string();
|
let name = app.get_name().to_string();
|
||||||
let outdir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("completions/");
|
let outdir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("completions/");
|
||||||
dbg!(&outdir);
|
dbg!(&outdir);
|
||||||
generate_to::<Bash, _, _>(&mut app, &name, &outdir).unwrap();
|
generate_to(Bash, &mut app, &name, &outdir).unwrap();
|
||||||
generate_to::<Zsh, _, _>(&mut app, &name, &outdir).unwrap();
|
generate_to(Zsh, &mut app, &name, &outdir).unwrap();
|
||||||
generate_to::<Fish, _, _>(&mut app, &name, &outdir).unwrap();
|
generate_to(Fish, &mut app, &name, &outdir).unwrap();
|
||||||
generate_to::<PowerShell, _, _>(&mut app, &name, &outdir).unwrap();
|
generate_to(PowerShell, &mut app, &name, &outdir).unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,16 +15,15 @@ _taskwarrior-tui() {
|
||||||
|
|
||||||
local context curcontext="$curcontext" state line
|
local context curcontext="$curcontext" state line
|
||||||
_arguments "${_arguments_options[@]}" \
|
_arguments "${_arguments_options[@]}" \
|
||||||
'-c+[Sets a custom config file]' \
|
'-c+[Sets a custom config file]:FILE: ' \
|
||||||
'--config=[Sets a custom config file]' \
|
'--config=[Sets a custom config file]:FILE: ' \
|
||||||
'-r+[Sets default report]' \
|
'-r+[Sets default report]:STRING: ' \
|
||||||
'--report=[Sets default report]' \
|
'--report=[Sets default report]:STRING: ' \
|
||||||
'-h[Print help information]' \
|
'-h[Print help information]' \
|
||||||
'--help[Print help information]' \
|
'--help[Print help information]' \
|
||||||
'-V[Print version information]' \
|
'-V[Print version information]' \
|
||||||
'--version[Print version information]' \
|
'--version[Print version information]' \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_taskwarrior-tui_commands] )) ||
|
(( $+functions[_taskwarrior-tui_commands] )) ||
|
||||||
|
|
|
@ -12,7 +12,6 @@ _taskwarrior-tui() {
|
||||||
taskwarrior-tui)
|
taskwarrior-tui)
|
||||||
cmd="taskwarrior__tui"
|
cmd="taskwarrior__tui"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -20,13 +19,12 @@ _taskwarrior-tui() {
|
||||||
|
|
||||||
case "${cmd}" in
|
case "${cmd}" in
|
||||||
taskwarrior__tui)
|
taskwarrior__tui)
|
||||||
opts=" -h -V -c -r --help --version --config --report "
|
opts="-h -V -c -r --help --version --config --report"
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
|
|
||||||
--config)
|
--config)
|
||||||
COMPREPLY=($(compgen -f "${cur}"))
|
COMPREPLY=($(compgen -f "${cur}"))
|
||||||
return 0
|
return 0
|
||||||
|
@ -50,7 +48,6 @@ _taskwarrior-tui() {
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue