diff options
author | Denis Isidoro <denis_isidoro@live.com> | 2019-09-20 10:59:53 -0300 |
---|---|---|
committer | Denis Isidoro <denis_isidoro@live.com> | 2019-09-20 10:59:53 -0300 |
commit | 4c9f8ba2ffd44d98e9f191e5121b255c85bbdb4e (patch) | |
tree | 283f52be1de3475ba1cdbc79f1ec1e892d9dcba2 | |
parent | 588be03ae89349cd16db0fbdefb0bce209900456 (diff) |
Move scriptv0.2.0
-rwxr-xr-x | cheats | 28 | ||||
-rwxr-xr-x | src/cheat.sh | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | src/main.sh (renamed from src/cheats) | 24 |
3 files changed, 29 insertions, 25 deletions
@@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -euo pipefail + +export DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" + +source "${DIR}/src/arg.sh" +source "${DIR}/src/cheat.sh" +source "${DIR}/src/docs.sh" +source "${DIR}/src/misc.sh" +source "${DIR}/src/selection.sh" +source "${DIR}/src/str.sh" +source "${DIR}/src/ui.sh" + +source "${DIR}/src/main.sh" + +##? Command cheatsheet tool +##? +##? Usage: +##? cheats [options] +##? +##? Options: +##? --print Prevent script execution [default: false] +##? --no-interpolation Prevent argument interpolation [default: false] +##? -c --cheat-folder <cheat-folder> Folder with cheatsheets + +docs::eval "$@" + +main "$@" diff --git a/src/cheat.sh b/src/cheat.sh index 2683cc2..85b6d36 100755 --- a/src/cheat.sh +++ b/src/cheat.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash cheat::find() { - find "${cheat_folder:-"${DIR}/../sheets"}" -iname '*.cheat' + find "${cheat_folder:-"${DIR}/sheets"}" -iname '*.cheat' } cheat::read_many() { diff --git a/src/cheats b/src/main.sh index 8b47b5a..4a2b1f6 100755..100644 --- a/src/cheats +++ b/src/main.sh @@ -1,28 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -export DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" - -source "${DIR}/arg.sh" -source "${DIR}/cheat.sh" -source "${DIR}/docs.sh" -source "${DIR}/misc.sh" -source "${DIR}/selection.sh" -source "${DIR}/str.sh" -source "${DIR}/ui.sh" - -##? Command cheatsheet tool -##? -##? Usage: -##? cheats [options] -##? -##? Options: -##? --print Prevent script execution [default: false] -##? --no-interpolation Prevent argument interpolation [default: false] -##? -c --cheat-folder <cheat-folder> Folder with cheatsheets - -docs::eval "$@" - main() { local readonly cheats="$(cheat::find)" local readonly selection="$(ui::select "$cheats")" @@ -57,5 +35,3 @@ main() { eval "$cmd" fi } - -main "$@"
\ No newline at end of file |