apple / apple/swift-argument-parser

Add first class citizen for "experimental" arguments

Open
#687 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Swift
Stars
3.8k
Forks
411
Avg merge
7d 14h
Merged PRs (30d)
15

Description

As a software developer, I want to define an argument as "experimental" and have swift-argument-parser handle adding the `--experimental` command line prefix

---
There are cases when we introduce an experimental command line argument to a command line tool. (e.g.: https://github.com/swiftlang/swift-package-manager/pull/8147/files#diff-e48104d0afa05391fe5ce04c6c616253d7770dab98a1f4497ac2a346606137aeR192)

instead of providing the name `experimental-`, it would be better to provide an boolean argument `isExperimental: Bool` which defaults to false. This way, there is consistency in the naming of experimental flag

**Acceptance Criteria:**

- an `isExperimental`, or equivalent, argument is available for all argument types.
- The `isExperimental` argument is a Boolean and defaults to `false`
- if the argument is set to `false`, argument parser behaves as it does today
- If the argument is set to `true`, the command line argument name is prefixed the name with `experimental-`. e.g.: `--experimental-`

Contributor guide

Open the contributing guide

Research direction

Start by locating the argument-type APIs and the existing command-line name handling, then inspect related tests for naming behavior. Done means every argument type accepts an optional Boolean defaulting to false, preserves current behavior when false, and uses the experimental- prefix when true.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.