-
Notifications
You must be signed in to change notification settings - Fork 6
/
.ok
23 lines (20 loc) · 1.89 KB
/
.ok
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Manipulate customizations (colors)
color.reset:unset _OK_C_HEADING;unset _OK_C_NUMBER; unset _OK_C_NUMBER2;unset _OK_C_COMMENT;unset _OK_C_COMMAND;unset _OK_C_PROMPT #Reset colors to defaults
color.text:_OK_C_HEADING="[h]";_OK_C_NUMBER="[N]";_OK_C_NUMBER2="[n]";_OK_C_COMMENT="[--]";_OK_C_COMMAND="[C]";_OK_C_PROMPT="[p]" #Change colors to text markers for debugging
color.custom: _OK_C_HEADING=$'\033[1;30;45m';_OK_C_NUMBER=$'\033[1;33;44m';_OK_C_NUMBER2=$'\033[0;33;44m';_OK_C_COMMENT=$'\033[1;34;46m';_OK_C_COMMAND=$'\033[1;37;44m' #Custom color scheme
# Other customizations
unset _OK_PROMPT; unset _OK_VERBOSE; unset _OK_LIST_PROMPT # Reset to defaults
_OK_PROMPT="-=> "; _OK_VERBOSE=2; _OK_PROMPT_DEFAULT=1; _OK_COMMENT_ALIGN=2 # Show a "nice" prompt, and give all the feedback ok can provide for, and default list'n'prompt, align comments over whitespace
_OK_PROMPT="% "; _OK_VERBOSE=0; _OK_PROMPT_DEFAULT=0; _OK_COMMENT_ALIGN=0 # Show ancient prompt, and only say the most necessary (don't even show executed command), no comment alignment
# Tests arguments passing (you can pass arguments after <number>, both at the bash-prompt and the ok-prompt)
args: echo "Passed arguments: 1:[$1], 2:[$2], 3:[$3], 4+:[${*:4}] (nr args: $#)" # Comment-color starts too early; clearly a bug (so better
args-all: echo "All passed arguments (no comment on this line): [$*]"
cd test
test: shellcheck -x ok.sh
env-reset: for x in $(set|grep "^_OK_[^_]"|awk -F = '{print $1}');do unset "$x";done # for when updating README help part
ok --verbose help # Show help page of 🆗, including environment variables
show-env: set | grep "^_OK_" # Show all set environment variables, used with ok-bash
echo -e "$PROMPT_COMMAND" # This variable can be changed with the reset/auto_show install helpers
alias SSH='ok -v -f ~/.ssh/.ok -a SSH' # Keep a list of all your `ssh` connections; use it via `SSH`
# Demo
cd demo/fmt; ok #go the the formatting demo