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