change: add compatibility with python2 & python3.

- add compatibility.
- add termcolor.py.
- remove aliass(search), just use acs.
- detect python.
This commit is contained in:
hqingyi 2015-11-29 14:10:56 +08:00
commit dda7a6b25f
3 changed files with 182 additions and 17 deletions

View file

@ -1,13 +1,10 @@
# with lots of 3rd-party amazing aliases installed, just need something to get it quickly.
#
# use alias as prefix:
# - aliass: search alias
# - aliascs: cheatsheet, group alias by command
function aliass(){
[[ $# -gt 0 ]] && alias | grep $@
}
function aliascs(){
local script_root=$(cd `dirname $0` && pwd)
alias | python $script_root/cheatsheet.py $@
# with lots of 3rd-party amazing aliases installed, just need something to explore it quickly.
#
# - acs: alias cheatsheet
# group alias by command, pass addition argv to grep.
ALIASES_PLUGIN_ROOT=$(cd `dirname $0` && pwd)
function acs(){
which python >>/dev/null
[[ $? -eq 1 ]] && echo "[error]no python executable detected!" && return
alias | python $ALIASES_PLUGIN_ROOT/cheatsheet.py $@
}