My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

43 lignes
748 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. -p
  20. -S
  21. -v
  22. )
  23. opts_with_arg=(
  24. -b
  25. -p
  26. )
  27. # Do not complete non option names
  28. [[ $cur == -* ]] || return 1
  29. # Do not complete when the previous arg is an option expecting an argument
  30. for opt in "${opts_with_arg[@]}"; do
  31. [[ $opt == $prev ]] && return 1
  32. done
  33. # Complete option names
  34. COMPREPLY=( $(compgen -W "${opts[*]}" -- "$cur") )
  35. return 0
  36. }
  37. complete -F _nnn nnn