My build of nnn with minor changes
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

42 řádky
737 B

  1. #
  2. # Rudimentary Bash completion definition for nnn.
  3. #
  4. # Author:
  5. # Arun Prakash Jana <engineerarun@gmail.com>
  6. #
  7. _nnn () {
  8. COMPREPLY=()
  9. local IFS=$' \n'
  10. local cur=$2 prev=$3
  11. local -a opts opts_with_args
  12. opts=(
  13. -c
  14. -e
  15. -h
  16. -i
  17. -l
  18. -p
  19. -S
  20. -v
  21. )
  22. opts_with_arg=(
  23. -c
  24. -p
  25. )
  26. # Do not complete non option names
  27. [[ $cur == -* ]] || return 1
  28. # Do not complete when the previous arg is an option expecting an argument
  29. for opt in "${opts_with_arg[@]}"; do
  30. [[ $opt == $prev ]] && return 1
  31. done
  32. # Complete option names
  33. COMPREPLY=( $(compgen -W "${opts[*]}" -- "$cur") )
  34. return 0
  35. }
  36. complete -F _nnn nnn