completion.fish 723 B

1234567891011121314151617181920212223242526272829
  1. # This file is part of the Symfony package.
  2. #
  3. # (c) Fabien Potencier <fabien@symfony.com>
  4. #
  5. # For the full copyright and license information, please view
  6. # https://symfony.com/doc/current/contributing/code/license.html
  7. function _sf_{{ COMMAND_NAME }}
  8. set sf_cmd (commandline -o)
  9. set c (count (commandline -oc))
  10. set completecmd "$sf_cmd[1]" "_complete" "--no-interaction" "-sfish" "-a{{ VERSION }}"
  11. for i in $sf_cmd
  12. if [ $i != "" ]
  13. set completecmd $completecmd "-i$i"
  14. end
  15. end
  16. set completecmd $completecmd "-c$c"
  17. set sfcomplete ($completecmd)
  18. for i in $sfcomplete
  19. echo $i
  20. end
  21. end
  22. complete -c '{{ COMMAND_NAME }}' -a '(_sf_{{ COMMAND_NAME }})' -f