cake-build / cake-build/resources

Fixing build.sh and argument parsing consistency

Open
#33 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
57
Forks
72
PR merge metrics
No merged PRs in 30d

Description

My PR https://github.com/cake-build/resources/pull/30 caused build.sh to stop accepting certain argument formattings that it used to accept. I thought cake.exe understood all these forms but it turns out it only understands `--target=foo`.

### Current (breaks some people):

| | cake.exe | build.ps1 | build.sh |
|----------------|----------|-----------|----------|
| `-t foo` | ❌ | ✔️ | ❌ |
| `-t=foo` | ❌ | ❌ | ❌ |
| `-t:foo` | ❌ | ✔️ | ❌ |
| `-target foo` | ❌ | ✔️ | ❌ |
| `-target:foo` | ❌ | ✔️ | ❌ |
| `--target foo` | ❌ | ❌ | ❌ |
| `--target=foo` | ✔️ | ✔️ | ✔️ |

### What we need:

| | cake.exe | build.ps1 | build.sh |
|----------------|----------|-----------|----------|
| `-t foo` | ❌ | ✔️ | ✔️ |
| `-t=foo` | ❌ | ❌ | ❌ |
| `-t:foo` | ❌ | ✔️ | ❌ |
| `-target foo` | ❌ | ✔️ | ❌ |
| `-target:foo` | ❌ | ✔️ | ❌ |
| `--target foo` | ❌ | ❌ | ✔️ |
| `--target=foo` | ✔️ | ✔️ | ✔️ |

This is what we used to have. Not having `--target Foo` broke an NUnit build. The fix (`--target=Foo`) is easy and IMO preferable but I assume you don't want the break in the first place. Assuming you don't,

- I need to get a bootstrapper fix in for this.

- We need to have tests in this repo for this.

-----

### What would be cool:

After the immediate fix is taken care of, I propose changing cake.exe so that it understands at least `-t foo`, `-t=foo`, and `--target foo` in addition to `--target=foo` so that build.sh can go back to not having a special understanding of any arguments beyond `--script`:

| | cake.exe | build.ps1 | build.sh |
|----------------|----------|-----------|----------|
| `-t foo` | ✔️ | ✔️ | ✔️ |
| `-t=foo` | ✔️ | ✔️ | ✔️ |
| `-t:foo` | ❌ | ✔️ | ❌ |
| `-target foo` | ❌ | ✔️ | ❌ |
| `-target:foo` | ❌ | ✔️ | ❌ |
| `--target foo` | ✔️ | ✔️ | ✔️ |
| `--target=foo` | ✔️ | ✔️ | ✔️ |

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.