mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
Add workaround for --help (#54)
My latest refactor didn't play nice with `--help`so I'm adding this workaround
This commit is contained in:
parent
e3b67bd731
commit
2ee253a56e
3 changed files with 7 additions and 3 deletions
7
navi
7
navi
|
@ -35,7 +35,12 @@ source "${SCRIPT_DIR}/src/main.sh"
|
|||
##? full docs
|
||||
##? Please refer to the README at https://github.com/denisidoro/navi
|
||||
|
||||
VERSION="0.9.0"
|
||||
VERSION="0.9.1"
|
||||
|
||||
# workaround while dict::* can't handle newlines
|
||||
case "${1:-}" in
|
||||
help|--help) opts::extract_help "$0" && exit 0 ;;
|
||||
esac
|
||||
|
||||
OPTIONS="$(opts::eval "$@")"
|
||||
export NAVI_PATH="$(dict::get "$OPTIONS" path)"
|
||||
|
|
|
@ -58,7 +58,6 @@ handler::preview() {
|
|||
|
||||
handler::text() {
|
||||
dict::get "$OPTIONS" text
|
||||
ui::clear_previous_line
|
||||
}
|
||||
|
||||
main() {
|
||||
|
|
|
@ -25,7 +25,7 @@ opts::eval() {
|
|||
case $arg in
|
||||
--print) print=true ;;
|
||||
--no-interpolation) interpolation=false ;;
|
||||
--version) dict::new entry_point "text" text "${VERSION:-unknown}" && exit 0 ;;
|
||||
--version|version) dict::new entry_point "text" text "${VERSION:-unknown}" && exit 0 ;;
|
||||
help|--help) dict::new entry_point "text" text "$(opts::extract_help "$0")" && exit 0 ;;
|
||||
--command-for) wait_for="command-for" ;;
|
||||
--no-preview) preview=false ;;
|
||||
|
|
Loading…
Reference in a new issue