mirror of
https://github.com/denisidoro/navi
synced 2024-11-10 14:04:17 +00:00
Fix preview
This commit is contained in:
parent
77acda383d
commit
638a3d2fc9
3 changed files with 13 additions and 3 deletions
|
@ -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>
|
||||
|
|
2
navi
2
navi
|
@ -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 "$@"
|
||||
|
|
12
src/opts.sh
12
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
|
||||
|
|
Loading…
Reference in a new issue