Skip to content

completion should not have shebang #2259

@janderssonse

Description

@janderssonse

My urfave/cli version is

v3 (latest)

Checklist

  • Are you running the latest v3 release?
  • Did you check the manual for your release?
  • Did you perform a search about this problem?

Dependency Management

  • My project is using go modules.

Describe the bug

The bash completion script from urfave cli includes #!/bin/bash on line 1, but bash completion files are sourced (not executed) and should not have a shebang.

To reproduce

myapp completion bash > completion.bash

Observed behavior

#!/bin/bash

Expected behavior

No shebang - the file should start with a comment or completion code directly.

Additional context

The shebang is in autocomplete/bash_autocomplete.

So for example when building packages with Debian's lintian warns: bash-completion-with-hashbang - "This file starts with the #! sequence that marks interpreted scripts, but it is a bash completion script that is merely intended to be sourced."

Want to fix this yourself?

Sadly not currently

Run go version and paste its output here

go version go1.25.0 linux/amd64

Run go env and paste its output here

N/A - issue is in the template file, not Go environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/v3relates to / is being considered for v3kind/bugdescribes or fixes a bugstatus/triagemaintainers still need to look into this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions