diff --git a/README.md b/README.md index ac7b950..c10d6b4 100644 --- a/README.md +++ b/README.md @@ -13,25 +13,28 @@ An interactive cheatsheet tool for the command-line so that you'll never say the ## Installation **Using [brew](https://brew.sh/):** -``` +```sh brew install denisidoro/tools/navi ``` **Without brew:** -``` +```sh git clone http://github.com/denisidoro/navi /opt/navi cd /opt/navi sudo make install +# install fzf: https://github.com/junegunn/fzf ``` ## Usage -Simply call `navi` - +Simply call: +```sh +navi +``` ## Trying it out online -Head to [this playground](https://www.katacoda.com/denisidoro/scenarios/navi) for previewing *navi*. +Head to [this playground](https://www.katacoda.com/denisidoro/scenarios/navi) for previewing **navi**. ## Motivation @@ -46,6 +49,13 @@ Or you can launch and browser and search for instructions on Google, but that ta **navi**, on the other hand, intends to be a general purpose platform for bookmarking any command at a very low cost. +## Using your own cheatsheets + +In this case, you need to pass the directory which contains `.cheat` files as in: +```sh +navi --dir /folder/with/cheats +``` + ## .cheat syntax - lines starting with `%` should contain tags which will be added to any command in a given file; diff --git a/navi b/navi index a05ffbd..4d23013 100755 --- a/navi +++ b/navi @@ -22,6 +22,6 @@ source "${SCRIPT_DIR}/src/main.sh" ##? --print Prevent script execution [default: false] ##? --no-interpolation Prevent argument interpolation [default: false] -VERSION="0.4.0" +VERSION="0.5.0" docs::eval "$@" main "$@" diff --git a/src/docs.sh b/src/docs.sh index e178462..7a125ea 100644 --- a/src/docs.sh +++ b/src/docs.sh @@ -13,6 +13,10 @@ docs::eval() { interpolation=true for arg in $@; do + case $wait_for in + dir) cheat_dir="$arg"; wait_for="";; + esac + case $arg in --print) print=true;; --no-interpolation) interpolation=false;; @@ -20,9 +24,7 @@ docs::eval() { --help) docs::extract_help "$0" && exit 0;; -d|--dir) wait_for="dir";; esac - - case $wait_for in - dir) cheat_dir="$arg"; wait_for="";; - esac done + + echo "cheat_dir: ${cheat_dir:-}" }