Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@DenKoren
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant