My build of nnn with minor changes
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

45 строки
770 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. -b
  14. -C
  15. -e
  16. -h
  17. -i
  18. -l
  19. -n
  20. -p
  21. -s
  22. -S
  23. -v
  24. )
  25. opts_with_arg=(
  26. -b
  27. -p
  28. )
  29. # Do not complete non option names
  30. [[ $cur == -* ]] || return 1
  31. # Do not complete when the previous arg is an option expecting an argument
  32. for opt in "${opts_with_arg[@]}"; do
  33. [[ $opt == $prev ]] && return 1
  34. done
  35. # Complete option names
  36. COMPREPLY=( $(compgen -W "${opts[*]}" -- "$cur") )
  37. return 0
  38. }
  39. complete -F _nnn nnn