Repository navigation
Expand file tree
/
Copy pathnavi
More file actions
executable file
·47 lines (41 loc) · 1.31 KB
/
Copy pathnavi
File metadata and controls
executable file
·47 lines (41 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -euo pipefail
export SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "${SCRIPT_DIR}/src/main.sh"
##? An interactive cheatsheet tool for the command-line
##?
##? Usage:
##? cheats [command] [<args>...] [options]
##?
##? Commands:
##? search <cmd> Search for cheatsheets on online repositories
##? query <cmd> Pre-filter results
##?
##? Options:
##? --print Prevent script execution
##? --path List of paths to look for cheats
48B6
##? --no-interpolation Prevent argument interpolation
##? --no-preview Hide command preview window
##?
##? Examples:
##? cheats
##? cheats --path '/some/folder:/another/folder'
##? cheats search awk
##? cheats search docker --print
##? cheats query git
##?
##? More info:
##? search
##? Queries cheatsheets from http://cheat.sh
##? Please note that these cheatsheets may not work out of the box
##? Always check the preview window before executing commands!
##? full docs
##? Please refer to the README at https://github.com/denisidoro/navi
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)"
main "$@"