26 Commits

Author SHA1 Message Date
Noah Gorny
ebe59c9adc Merge pull request #1850 from tbhaxor/feature/completion/ngrok
Added completion for ngrok tool
2021-04-04 22:36:13 +03:00
Noah Gorny
a6e2c2fc13 Merge pull request #1863 from artemkovalyov/patch-2
add --no-start to docker-compose up command
2021-04-04 22:35:19 +03:00
Noah Gorny
6678788f19 Merge pull request #1857 from bingzhangdai/bindai/extract-plugin
Update extract.plugin.bash, extract compressed file to target directory
2021-04-04 22:34:48 +03:00
Noah Gorny
4f0fa7ebe7 Merge pull request #1862 from NoahGorny/fix-install-error
install: Dont quote number vars, to support older bash versions
2021-04-04 22:34:25 +03:00
Artem Kovalov
905abd37f8 add --no-start to up command 2021-04-03 13:15:04 +02:00
Noah Gorny
a8b43620f8 install: Dont quote number vars, to support older bash versions 2021-04-01 17:59:59 +03:00
Noah Gorny
0239ab8c31 completion: ngrok: Add --help option 2021-04-01 00:37:49 +03:00
Noah Gorny
1dfaf36d91 completion: ngrok: Only complete the list in case prev is ngrok 2021-04-01 00:37:49 +03:00
Noah Gorny
e06066c367 Merge pull request #1842 from Titivoot/master
easy theme added
2021-04-01 00:35:15 +03:00
Gurkirat Singh
035fc920ad completion (improvement): remove if statement 2021-04-01 00:34:37 +03:00
Gurkirat Singh
ab011cd9ba completion (improvement): fixed linting 2021-04-01 00:34:37 +03:00
Gurkirat Singh
d42a1206f9 completion (feature): implemented ngrok 2021-04-01 00:34:37 +03:00
Noah Gorny
ce854255b4 Merge pull request #1833 from NoahGorny/add-license-to-docs
add license to docs
2021-04-01 00:29:07 +03:00
Noah Gorny
9524bf85ae docs: Add easy theme to themes image list 2021-04-01 00:28:28 +03:00
Titivoot Pangrit
6866648ac6 Add theme Easy 2021-04-01 00:28:28 +03:00
Noah Gorny
514a753901 Merge pull request #1858 from lintonf/patch-1
Fix spelling mistake with terraform destroy alias
2021-03-31 23:56:58 +03:00
Linton Fisher
0b808b17f1 Fix spelling mistake 2021-03-30 00:57:13 +01:00
Noah Gorny
4860fb8c60 Merge pull request #1849 from tiagobarros99/purity-add-virtualenv
purity theme, added virtualenv name display
2021-03-25 19:16:35 +02:00
tiago
cda81f3d74 cleaned and linted purity theme 2021-03-24 21:39:57 +00:00
Bingzhang Dai
7331cd2676 Update extract.plugin.bash 2021-03-24 18:42:44 +08:00
Bingzhang Dai
399b5199b0 Update extract.plugin.bash, support to extract zip to target directory 2021-03-24 17:04:21 +08:00
tiago
64c4c30706 minor change 2021-03-17 15:39:57 +00:00
tiago
ea444459cf improved PS1, function rename 2021-03-17 15:26:39 +00:00
tiago
682d6d728d added python's virtualenv name 2021-03-10 15:24:32 +00:00
Noah Gorny
e25e371ba7 docs: Add newline in readme and index.rst 2021-02-06 23:17:18 +02:00
Noah Gorny
e4e0c151b2 docs: Add license notice to readme 2021-02-06 23:16:58 +02:00
12 changed files with 125 additions and 10 deletions

View File

@@ -7,3 +7,4 @@ alias dco="docker-compose"
alias dcofresh="docker-compose-fresh" alias dcofresh="docker-compose-fresh"
alias dcol="docker-compose logs -f --tail 100" alias dcol="docker-compose logs -f --tail 100"
alias dcou="docker-compose up" alias dcou="docker-compose up"
alias dcouns="dcou --no-start"

View File

@@ -7,4 +7,4 @@ alias tf='terraform'
alias tfv='terraform validate' alias tfv='terraform validate'
alias tfp='terraform plan' alias tfp='terraform plan'
alias tfa='terraform apply' alias tfa='terraform apply'
alias tfd='terraform destory' alias tfd='terraform destroy'

View File

@@ -43,7 +43,9 @@ themes/bobby-python
themes/brainy themes/brainy
themes/brunton themes/brunton
themes/command_duration.theme.bash themes/command_duration.theme.bash
themes/easy
themes/modern themes/modern
themes/purity
# plugins # plugins
# #
@@ -82,6 +84,7 @@ completion/available/kubectl.completion.bash
completion/available/lerna.completion.bash completion/available/lerna.completion.bash
completion/available/minikube.completion.bash completion/available/minikube.completion.bash
completion/available/notify-send.completion.bash completion/available/notify-send.completion.bash
completion/available/ngrok.completion.bash
completion/available/npm.completion.bash completion/available/npm.completion.bash
completion/available/packer.completion.bash completion/available/packer.completion.bash
completion/available/pip.completion.bash completion/available/pip.completion.bash

View File

@@ -0,0 +1,45 @@
# shellcheck shell=bash
__ngrok_completion() {
local prev=$(_get_pword)
local curr=$(_get_cword)
local BASE_NO_CONF="--log --log-format --log-level --help"
local BASE="--config $BASE_NO_CONF"
local DEFAULT="$BASE --authtoken --region"
case $prev in
authtoken)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$BASE" -- "$curr"))
;;
http)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --auth --bind-tls --host-header --hostname --inspect --subdomain" -- "$curr"))
;;
start)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --all --none" -- "$curr"))
;;
tcp)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --remote-addr" -- "$curr"))
;;
tls)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --client-cas --crt --hostname --key --subdomain" -- "$curr"))
;;
update)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$BASE_NO_CONF --channel" -- "$curr"))
;;
ngrok)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "authtoken credits http start tcp tls update version help" -- "$curr"))
;;
*) ;;
esac
}
complete -F __ngrok_completion ngrok

View File

@@ -9,7 +9,7 @@
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more. Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work. Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you! If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-it and start hacking away. Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-it and start hacking away.
- [Main Page](https://bash-it.readthedocs.io/en/latest) - [Main Page](https://bash-it.readthedocs.io/en/latest)
@@ -55,4 +55,8 @@ please feel free to read through this page if you're interested in how Bash-it l
* [List of contributors][contribute] * [List of contributors][contribute]
## License
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).
[contribute]: https://github.com/Bash-it/bash-it/contributors [contribute]: https://github.com/Bash-it/bash-it/contributors

View File

@@ -8,7 +8,7 @@ Welcome to Bash-it's documentation!
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more. Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work. Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
If you're using the *Bourne Again Shell* (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you! If you're using the *Bourne Again Shell* (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
Stop polluting your ``~/bin`` directory and your ``.bashrc`` file, fork/clone Bash-it and start hacking away. Stop polluting your ``~/bin`` directory and your ``.bashrc`` file, fork/clone Bash-it and start hacking away.
.. toctree:: .. toctree::

14
docs/themes-list/easy.rst Normal file
View File

@@ -0,0 +1,14 @@
.. _easy:
Easy Theme
==========
A simple theme
Examples
--------
.. code-block:: bash
user@hostname ~/.bash_it
[ master ✓ ]

View File

@@ -187,6 +187,22 @@ Doubletime Multiline Python Only
:alt: :alt:
----
Easy
^^^^
.. image:: https://bash-it.github.io/bash-it/docs/images/easy-black.jpg
:target: https://bash-it.github.io/bash-it/docs/images/easy-black.jpg
:alt:
.. image:: https://bash-it.github.io/bash-it/docs/images/easy-white.jpg
:target: https://bash-it.github.io/bash-it/docs/images/easy-white.jpg
:alt:
---- ----
Envy Envy

View File

@@ -171,7 +171,8 @@ while getopts "hsinaf" opt; do
;; ;;
esac esac
done done
shift $(("$OPTIND" - 1))
shift $((OPTIND - 1))
if [[ $silent ]] && [[ $interactive ]]; then if [[ $silent ]] && [[ $interactive ]]; then
echo -e "\033[91mOptions --silent and --interactive are mutually exclusive. Please choose one or the other.\033[m" echo -e "\033[91mOptions --silent and --interactive are mutually exclusive. Please choose one or the other.\033[m"

View File

@@ -37,7 +37,7 @@ End-Of-Usage
local -r filename=$(basename -- $1) local -r filename=$(basename -- $1)
local -r filedirname=$(dirname -- $1) local -r filedirname=$(dirname -- $1)
local targetdirname=$(sed 's/\(\.tar\.bz2$\|\.tbz$\|\.tbz2$\|\.tar\.gz$\|\.tgz$\|\.tar$\|\.tar\.xz$\|\.txz$\|\.tar\.Z$\|\.7z$\)//g' <<< $filename) local targetdirname=$(sed 's/\(\.tar\.bz2$\|\.tbz$\|\.tbz2$\|\.tar\.gz$\|\.tgz$\|\.tar$\|\.tar\.xz$\|\.txz$\|\.tar\.Z$\|\.7z$\|\.nupkg$\|\.zip$\|\.war$\|\.jar$\)//g' <<< $filename)
if [ "$filename" = "$targetdirname" ]; then if [ "$filename" = "$targetdirname" ]; then
# archive type either not supported or it doesn't need dir creation # archive type either not supported or it doesn't need dir creation
targetdirname="" targetdirname=""
@@ -61,9 +61,9 @@ End-Of-Usage
*.rpm) rpm2cpio "$1" | cpio -idm${verbose} ;; *.rpm) rpm2cpio "$1" | cpio -idm${verbose} ;;
*.tar) tar "x${verbose}f" "$1" -C "$filedirname/$targetdirname" ;; *.tar) tar "x${verbose}f" "$1" -C "$filedirname/$targetdirname" ;;
*.xz) xz --decompress "$1" ;; *.xz) xz --decompress "$1" ;;
*.zip|*.war|*.jar) unzip "$1" ;; *.zip|*.war|*.jar|*.nupkg) unzip "$1" -d "$filedirname/$targetdirname" ;;
*.Z) uncompress "$1" ;; *.Z) uncompress "$1" ;;
*.7z) 7za x "$1" ;; *.7z) 7za x -o"$filedirname/$targetdirname" "$1" ;;
*) echo "'$1' cannot be extracted via extract" >&2;; *) echo "'$1' cannot be extracted via extract" >&2;;
esac esac
fi fi

View File

@@ -0,0 +1,19 @@
# shellcheck shell=bash
SCM_THEME_PROMPT_PREFIX="${bold_green}[ ${normal}"
SCM_THEME_PROMPT_SUFFIX="${bold_green} ] "
SCM_THEME_PROMPT_DIRTY=" ${red}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}"
prompt_command() {
if [ "$(whoami)" = root ]; then
cursor_color="${bold_red}"
user_color="${green}"
else
cursor_color="${bold_green}"
user_color="${white}"
fi
PS1="${user_color}\u${normal}@${white}\h ${bold_black}\w\n${reset_color}$(scm_prompt_info)${cursor_color} ${normal}"
}
safe_append_prompt_command prompt_command

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash # shellcheck shell=bash
SCM_THEME_PROMPT_DIRTY=" ${bold_red}${normal}" SCM_THEME_PROMPT_DIRTY=" ${bold_red}${normal}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}${normal}" SCM_THEME_PROMPT_CLEAN=" ${bold_green}${normal}"
@@ -14,9 +14,21 @@ STATUS_THEME_PROMPT_BAD="${bold_red}${reset_color}${normal} "
STATUS_THEME_PROMPT_OK="${bold_green}${reset_color}${normal} " STATUS_THEME_PROMPT_OK="${bold_green}${reset_color}${normal} "
PURITY_THEME_PROMPT_COLOR="${PURITY_THEME_PROMPT_COLOR:=$blue}" PURITY_THEME_PROMPT_COLOR="${PURITY_THEME_PROMPT_COLOR:=$blue}"
venv_prompt() {
python_venv=""
# Detect python venv
if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then
python_venv="($PYTHON_VENV_CHAR${CONDA_DEFAULT_ENV}) "
elif [[ -n "${VIRTUAL_ENV}" ]]; then
python_venv="($PYTHON_VENV_CHAR$(basename "${VIRTUAL_ENV}")) "
fi
[[ -n "${python_venv}" ]] && echo "${python_venv}"
}
function prompt_command() { function prompt_command() {
local ret_status="$( [ $? -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")" retval=$?
PS1="\n${PURITY_THEME_PROMPT_COLOR}\w $(scm_prompt_info)\n${ret_status} " local ret_status="$([ $retval -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")"
PS1="\n${PURITY_THEME_PROMPT_COLOR}\w $(scm_prompt_info)\n${ret_status}$(venv_prompt)"
} }
safe_append_prompt_command prompt_command safe_append_prompt_command prompt_command