Skip to content

PowerShell Completion missing Native parameter #2437

Description

@jfishe

chezmoi PowerShell Completion missing Native parameter #5133 uses cobra to generate PowerShell completion.

Describe the bug

chezmoi completion powershell produces:

Register-ArgumentCompleter -CommandName 'chezmoi' -ScriptBlock ${__chezmoiCompleterBlock} which does not include the Native parameter. Expected behavior is:

Register-ArgumentCompleter -Native -CommandName 'chezmoi' -ScriptBlock ${__chezmoiCompleterBlock}

To reproduce

pwsh --noprofile
chezmoi completion powershell

Expected behavior

Register-ArgumentCompleter -Native -CommandName 'chezmoi' -ScriptBlock ${__chezmoiCompleterBlock} -Native is missing from chezmoi generated PowerShell.

Additional context

This appears to apply to chezmoi: Even though it’s not documented as a requirement, it is the correct choice when:

  • Completing arguments for an external executable
  • The executable uses non‑PowerShell quoting rules
  • The executable expects POSIX‑style flags or subcommands
  • The completer needs the raw text exactly as typed

Activity

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

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