diff options
author | Denis Isidoro <denis_isidoro@live.com> | 2019-09-22 12:10:51 -0300 |
---|---|---|
committer | Denis Isidoro <denis_isidoro@live.com> | 2019-09-22 12:10:51 -0300 |
commit | 638a3d2fc94de4410b130880c1a9c5c389f62912 (patch) | |
tree | 486e79b6a09440bcd3fdff1b71d7e9f83e4fd8fa | |
parent | 77acda383df96d757df1d3bdaa328b5d15b3a5f6 (diff) |
Fix previewv0.8.1
-rw-r--r-- | cheats/git.cheat | 2 | ||||
-rwxr-xr-x | navi | 2 | ||||
-rw-r--r-- | src/opts.sh | 12 |
3 files changed, 13 insertions, 3 deletions
diff --git a/cheats/git.cheat b/cheats/git.cheat index 7913d94..957239b 100644 --- a/cheats/git.cheat +++ b/cheats/git.cheat @@ -29,7 +29,7 @@ git add <filename> git add . # Saves the changes to a file in a commit -git commit -m "<message>" +git commit -m <message> # Pushes committed changes to remote repository git push -u <remote_name> <branch_name> @@ -35,7 +35,7 @@ source "${SCRIPT_DIR}/src/main.sh" ##? full docs ##? Please refer to the README at https://github.com/denisidoro/navi -VERSION="0.8.0" +VERSION="0.8.1" opts::eval "$@" main "$@" diff --git a/src/opts.sh b/src/opts.sh index 552406d..a96a7fd 100644 --- a/src/opts.sh +++ b/src/opts.sh @@ -6,6 +6,16 @@ opts::extract_help() { grep "^##?" "$file" | cut -c 5- } +opts::preview_hack() { + local readonly arg="$1" + + if [ ${arg:0:1} = "'" ]; then + echo "${arg:1:${#arg}-2}" + else + echo "$arg" + fi +} + opts::eval() { local readonly wait_for="" @@ -17,7 +27,7 @@ opts::eval() { for arg in "$@"; do case $wait_for in path) NAVI_PATH="$arg"; wait_for="" ;; - preview) query="$(echo "$arg" | tr "^" " ")"; wait_for=""; break ;; + preview) query="$(opts::preview_hack "$arg" | tr "^" " ")"; wait_for=""; break ;; search) query="$arg"; wait_for=""; export NAVI_PATH="${NAVI_PATH}:$(search::full_path "$query")"; ;; query) query="$arg"; wait_for="" ;; esac |