2 Star 0 Fork 0

liuyibin23/bench

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
completion.sh 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
_bench_completion() {
# Complete commands using click bashcomplete
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
_BENCH_COMPLETE=complete $1 ) )
if [ -d "sites" ]; then
# Also add frappe commands if present
# bench_helper.py expects to be executed from "sites" directory
cd sites
# All frappe commands are subcommands under "bench frappe"
# Frappe is only installed in virtualenv "env" so use appropriate python executable
COMPREPLY+=( $( COMP_WORDS="bench frappe "${COMP_WORDS[@]:1} \
COMP_CWORD=$(($COMP_CWORD+1)) \
_BENCH_COMPLETE=complete ../env/bin/python ../apps/frappe/frappe/utils/bench_helper.py ) )
# If the word before the current cursor position in command typed so far is "--site" then only list sites
if [ ${COMP_WORDS[COMP_CWORD-1]} == "--site" ]; then
COMPREPLY=( $( ls -d ./*/site_config.json | cut -f 2 -d "/" | xargs echo ) )
fi
# Get out of sites directory now
cd ..
fi
return 0
}
# Only support bash and zsh
if [ -n "$BASH" ] ; then
complete -F _bench_completion -o default bench;
elif [ -n "$ZSH_VERSION" ]; then
# Use zsh in bash compatibility mode
autoload bashcompinit
bashcompinit
complete -F _bench_completion -o default bench;
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuyibin23/bench.git
git@gitee.com:liuyibin23/bench.git
liuyibin23
bench
bench
master

搜索帮助