_lcli 335 B

12345678910111213141516171819202122
  1. #compdef lcli
  2. _lcli () {
  3. local state context line expl ret=1
  4. typeset -A opt_args
  5. local tmp cmd
  6. _arguments \
  7. "1:commands:(($(lcli --list-commands | sed -e 's/\s\+\(.*\)/\\:"\1"/')))" \
  8. '*:: :->command'
  9. if [[ -z $state ]]; then
  10. ret=0
  11. else
  12. words[1]=lcli_$words[1]
  13. _normal && ret=0
  14. fi
  15. return ret
  16. }