cake-build / cake-build/cake

Allow short argument names when using double dashed args

Open
#3,278 11 comments 0 reactions 0 assignees View on GitHub
Hold Improvement
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
3h 37m
Merged PRs (30d)
21

Description

### Background

Currently one-letter arguments are only supported with single-dashed arguments. e.g.

This works:

```powershell
dotnet cake -a=5
```

Whereas this does not work (error: `Invalid long option name`)

```powershell
dotnet cake --a=5
```

### Proposal

This issue intends to make the necessary updates to allow short argument names when using double-dashed arguments.

### Important

Cake uses [Spectre.Console](https://github.com/spectreconsole/spectre.console) for parsing arguments, so there's a little bit of investigation needed to see if the fix can (and should) be done directly in Cake, of if it should be fixed [upstream](https://github.com/spectreconsole/spectre.console). If you discover that the fix doesn't belong in Cake, you'd need to send a PR to Spectre.Console and the fix in Cake would be just upgrading to a newer version of [Spectre.Console](https://github.com/spectreconsole/spectre.console).

---

Related:
- [Feature Request: CLI Help Improvements](https://github.com/cake-build/cake/issues/2331)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the documented `dotnet cake --a=5` failure and inspect Cake's integration with Spectre.Console argument parsing. Determine whether the change belongs in Cake or upstream; done means the double-dashed one-letter argument is accepted and the appropriate project has the needed update.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.