Compare commits
2
Commits
traefik
...
completion
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb4b41e2ff | ||
|
|
16f1bef125 |
@@ -0,0 +1,10 @@
|
||||
all:
|
||||
@echo -e "\n\033[1;36m --> Installing the module ...\033[0m\n"
|
||||
pip install --user -e .
|
||||
@echo -ne "\n\033[1;36m"; \
|
||||
read -p " --> Install autocompletion ?[Y|n] " RESP; \
|
||||
echo -e "\n\033[0m"; \
|
||||
case "$$RESP" in \
|
||||
y*|Y*|"")sudo cp -v completion.bash /usr/share/bash-completion/completions/shlax;; \
|
||||
*);; \
|
||||
esac;
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
_action(){
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
if [[ "$COMP_CWORD" -eq 1 ]] ; then
|
||||
COMPREPLY=($(compgen -W "$(ls shlax/repo/*.py | sed s/^.*\\/\// | cut -d "." -f 1)" "${cur}"))
|
||||
else
|
||||
action=$(grep "^[^ #)]\w* =" shlax/repo/${COMP_WORDS[1]}.py | cut -d " " -f 1)
|
||||
COMPREPLY=($(compgen -W "$action" "${cur}"))
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _action shlax
|
||||
+1
-1
@@ -33,10 +33,10 @@ class ConsoleScript(cli2.ConsoleScript):
|
||||
self.exit_code = 1
|
||||
return
|
||||
shlaxfile = mod.__file__
|
||||
self._doc = inspect.getdoc(mod)
|
||||
|
||||
self.shlaxfile = Shlaxfile()
|
||||
self.shlaxfile.parse(shlaxfile)
|
||||
self._doc = inspect.getdoc(mod)
|
||||
if 'main' in self.shlaxfile.actions:
|
||||
action = self.shlaxfile.actions['main']
|
||||
for name, child in self.shlaxfile.actions['main'].menu.items():
|
||||
|
||||
Reference in New Issue
Block a user