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

Remove shebang to bash completion file #2853

Closed
wants to merge 1 commit into from
Closed

Remove shebang to bash completion file #2853

wants to merge 1 commit into from

Commits on Nov 27, 2020

  1. Remove shebang to bash completion file

    Bash completion files are meant to be sourced, not executed, hence there
    should be no shebang at the beginning of the file.
    
    For reference, this is what Lintian (Debian tool to find errors in
    packages) says about it (see [1]):
    
      This file starts with the #! sequence that marks interpreted scripts,
      but it is a bash completion script that is merely intended to be
      sourced.
      .
      Please remove the line with hashbang, including any designated
      interpreter.
    
    On my Debian system, I looked at the other bash completions scripts, and
    indeed the utmost majority has no shebang:
    
      $ pwd
      /usr/share/bash-completion/completions
    
      $ ls -1 | wc -l
      1077
    
      $ grep '^#!' * | wc -l
      15
    
    Hence this commit removes the shebang, and in order to preserve
    indentation and highlighting in common code editors, it adds two hints:
    - an Emacs "file variable" on the first line ('-*- ... -*-'), see [2]
    - a Vim modeline on the last line ('ex: '), see [3]
    
    Once again, one can look at other bash completion files in
    /usr/share/bash-completion to see that these 2 hints are present in the
    majority of the files.
    
    [1] https://lintian.debian.org/tags/bash-completion-with-hashbang.html
    [2] https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html
    [3] https://vi.stackexchange.com/a/11558
    
    Signed-off-by: Arnaud Rebillout <elboulangero@gmail.com>
    elboulangero committed Nov 27, 2020
    Configuration menu
    Copy the full SHA
    40c8be7 View commit details
    Browse the repository at this point in the history