apple / apple/swift-argument-parser

Bash completion: Does not handle sub-commands with hyphens

Open
#780 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
3.8k
Forks
411
Avg merge
7d 13h
Merged PRs (30d)
17

Description

The bash completion doesn't handle subcommands that have hyphens in them correctly.

**ArgumentParser version:** `1.5.0` and main
**Swift version:** N/A

### Checklist
- [x] If possible, I've reproduced the issue using the `main` branch of this package
- [x] I've searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues)

### Steps to Reproduce
The unit tests have a subcommand and the generated bash completion doesn't actually work. So the tests already reproduce the issue if the bash completion is loaded.

### Expected behavior
Subcommand completion should be correct.

### Actual behavior
```
_base_test_sub-command: command not found
```

Contributor guide

Open the contributing guide

Research direction

Start with the unit tests mentioned in the issue and load their generated Bash completion to reproduce the `_base_test_sub-command: command not found` error. Trace the completion generation for hyphenated subcommands, then verify that completing such a subcommand works correctly without the command-not-found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, swift
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.