mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 14:36:42 +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 outdir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("completions/");
|
||||
dbg!(&outdir);
|
||||
generate_to::<Bash, _, _>(&mut app, &name, &outdir).unwrap();
|
||||
generate_to::<Zsh, _, _>(&mut app, &name, &outdir).unwrap();
|
||||
generate_to::<Fish, _, _>(&mut app, &name, &outdir).unwrap();
|
||||
generate_to::<PowerShell, _, _>(&mut app, &name, &outdir).unwrap();
|
||||
generate_to(Bash, &mut app, &name, &outdir).unwrap();
|
||||
generate_to(Zsh, &mut app, &name, &outdir).unwrap();
|
||||
generate_to(Fish, &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
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-c+[Sets a custom config file]' \
|
||||
'--config=[Sets a custom config file]' \
|
||||
'-r+[Sets default report]' \
|
||||
'--report=[Sets default report]' \
|
||||
'-c+[Sets a custom config file]:FILE: ' \
|
||||
'--config=[Sets a custom config file]:FILE: ' \
|
||||
'-r+[Sets default report]:STRING: ' \
|
||||
'--report=[Sets default report]:STRING: ' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
&& ret=0
|
||||
|
||||
}
|
||||
|
||||
(( $+functions[_taskwarrior-tui_commands] )) ||
|
||||
|
|
|
@ -12,7 +12,6 @@ _taskwarrior-tui() {
|
|||
taskwarrior-tui)
|
||||
cmd="taskwarrior__tui"
|
||||
;;
|
||||
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
@ -20,13 +19,12 @@ _taskwarrior-tui() {
|
|||
|
||||
case "${cmd}" in
|
||||
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
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
fi
|
||||
case "${prev}" in
|
||||
|
||||
--config)
|
||||
COMPREPLY=($(compgen -f "${cur}"))
|
||||
return 0
|
||||
|
@ -50,7 +48,6 @@ _taskwarrior-tui() {
|
|||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue