openmsx-complete.bash 574 B

1234567891011121314151617181920
  1. # This file enables openmsx specific tab-completion in the bash shell.
  2. #
  3. # To enable it system-wide, copy and rename this file to
  4. # /etc/bash_completion.d/openmsx
  5. # To enable it only for the current user, source this file from e.g. your
  6. # ~/.bashrc
  7. # file.
  8. #
  9. # This needs an openMSX version newer than openmsx-0.9.1 (TODO replace with
  10. # actual version number once that number is known).
  11. _openmsx_complete()
  12. {
  13. local cur tmp
  14. cur=${COMP_WORDS[COMP_CWORD]}
  15. tmp=$(openmsx -bash $3)
  16. COMPREPLY=($(compgen -W '$tmp' -- "$cur"))
  17. }
  18. complete -f -F _openmsx_complete openmsx