Skip to content

Shell completion scripts variously do not properly handle repeating and/or non-repeating positional arguments, flags, or options #806

@rgoldberg

Description

@rgoldberg

Generated shell completion scripts variously do not properly handle repeating and/or non-repeating positional arguments, flags, or options.

The correctness of the behavior depends on the shell, if it's a positional argument, flag, or option, and if it's repeating or non-repeating.

Completions should work correctly regardless of shell, regardless of argument, flag, or option, and regardless of repeating or non-repeating.

ArgumentParser version: main
Swift version:
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0

Checklist

  • If possible, I've reproduced the issue using the main branch of this package
  • I've searched for existing GitHub issues

Steps to Reproduce

Try to complete repeating & non-repeating positional arguments, flags, and options in all 3 shells.

Expected behavior

Repeating positional arguments, flags, and options are offered as completion candidates indefinitely for all 3 shells.
Non-repeating positional arguments, flags, and options are offered as completion candidates only once for all 3 shells.

Actual behavior

Different shells have incorrect behaviors for repeating or non-repeating positional arguments, flags, and/or options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions