Use -follow on "find" at bash_completion script to complete for nginx_dissite. #4

Open
DenKoren opened this Issue Mar 20, 2013 · 0 comments

Projects

None yet

1 participant

Your bash completion script has a bug. It does not suggest any completion for nginx_dissite because "find -type f" shows only regular files, but sites_enabled has only symlinks.

Use -follow as bugfix:

--- nginx-ensite 2013-03-20 13:58:39.000000000 +0000
+++ /etc/bash_completion.d/nginx-ensite 2013-03-20 13:58:11.000000000 +0000
@@ -32,7 +32,7 @@

Handling of both enabled and available sites.

_nginx_sites() {
# Get the available or enabled sites for nginx.

  • COMPREPLY=( $( compgen -W '$( command find /etc/nginx/$1 -type f -printf "%P " 2>/dev/null \
  • COMPREPLY=( $( compgen -W '$( command find /etc/nginx/$1 -type f -follow -printf "%P " 2>/dev/null
    | sed 's/[.]conf$//' )' -- $cur ) )
    }

P.S. Thanks for useful scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment