dtools_completion 960 B

1234567891011121314151617181920212223
  1. # bash completion for dtools
  2. #
  3. # Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  4. # All rights reserved.
  5. #
  6. # This software is supplied "AS IS" without any warranties.
  7. # RDA assumes no responsibility or liability for the use of the software,
  8. # conveys no license or title under any patent, copyright, or mask work
  9. # right to the product. RDA reserves the right to make changes in the
  10. # software without notification. RDA also make no representation or
  11. # warranty that such application will be suitable for the specified use
  12. # without further testing or modification.
  13. __dtools_complete() {
  14. if [[ "1" -eq "$COMP_CWORD" ]]; then
  15. local _program=$1
  16. local _cmdlist=$(${_program/\~/$HOME} cmdlist)
  17. COMPREPLY=($(compgen -W "$_cmdlist" -- "${COMP_WORDS[COMP_CWORD]}"))
  18. return
  19. fi
  20. }
  21. complete -o nospace -o default -F __dtools_complete dtools
  22. complete -o nospace -o default -F __dtools_complete dtools.exe