Skip to content

functions in fish shell completion auto-generated file should not contain "-" character #1121

@umbynos

Description

@umbynos

As asked by @marckhouzam here, I'm opening this issue.
I'm working on this PR and I noticed a problem with the auto-generated cobra completion file for fish shell: If the root command to complete contains a dash character in the name "-" (e.g. arduino-cli) the autocompletion will not work because of function naming (a function called __arduino-cli_comp_do_file_comp is created). For reference: fish-shell/fish-shell#1206

To fix this I simply replaced "-" with "_" here. But maybe it's better to fix this behaviour in cobra? Something like: if the command name contains a dash character automatically is replaced with an underscore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions