added shell completions for push subcommands and pop
This commit is contained in:
+21
-1
@@ -21,12 +21,32 @@ function book {
|
||||
__call_navigate "bookmark $@"
|
||||
}
|
||||
|
||||
# completion for `book`
|
||||
# completion function for `book`
|
||||
function _book {
|
||||
CURRENT_WORD=${COMP_WORDS[COMP_CWORD]}
|
||||
if [[ COMP_CWORD -eq 1 ]]; then
|
||||
BOOKMARKS="add remove $(__call_navigate bookmark names)"
|
||||
COMPREPLY=($(compgen -W "${BOOKMARKS}" -- $CURRENT_WORD))
|
||||
elif [[ COMP_CWORD -eq 2 ]]; then
|
||||
if [[ COMP_WORDS[1] -eq "remove" ]]; then
|
||||
BOOKMARKS="$(__call_navigate bookmark names)"
|
||||
COMPREPLY=($(compgen -W "${BOOKMARKS}" -- $CURRENT_WORD))
|
||||
fi
|
||||
elif [[ COMP_CWORD -eq 3 ]]; then
|
||||
if [[ COMP_WORDS[1] -eq "add" ]]; then
|
||||
COMPREPLY=($(compgen -o dirnames -- $CURRENT_WORD))
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# completion function for `pop`
|
||||
function _pop {
|
||||
CURRENT_WORD=${COMP_WORDS[COMP_CWORD]}
|
||||
if [[ COMP_CWORD -eq 1 ]]; then
|
||||
COMPREPLY=($(compgen -W "all <number>"))
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o dirnames push
|
||||
complete -F _pop pop
|
||||
complete -F _book book
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
- [x] implement procedural macro for config
|
||||
- [x] .. to parse config
|
||||
- [ ] .. to write default config
|
||||
- [ ] .. ignore comments in config file
|
||||
- [x] .. ignore comments in config file
|
||||
- [x] parse config file
|
||||
- [ ] apply config -- partially more done than before :)
|
||||
- [x] `show-bookmarks-on-book`
|
||||
@@ -16,4 +16,5 @@
|
||||
- [x] bookmarks
|
||||
- [x] do not resolve links in bookmarks
|
||||
- [ ] push <number> to push path in stack
|
||||
- [ ] write documentation
|
||||
- [/] write documentation
|
||||
- [x] change config file extension to `.toml`
|
||||
|
||||
Reference in New Issue
Block a user