Skip to content

Commit 4870945

Browse files
Version Packages
1 parent 0d1a44f commit 4870945

3 files changed

Lines changed: 25 additions & 22 deletions

File tree

.changeset/cli-options-after-args.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/cli/CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# @effect/cli
22

3+
## 0.73.1
4+
5+
### Patch Changes
6+
7+
- [#5983](https://github.com/Effect-TS/effect/pull/5983) [`0d1a44f`](https://github.com/Effect-TS/effect/commit/0d1a44fa142c0da25fe36a1ac35675f666944803) Thanks @cevr! - Allow options to appear after positional arguments
8+
9+
Previously, `@effect/cli` required all options to appear before positional arguments. For example, `cmd --force staging` worked but `cmd staging --force` failed with "Received unknown argument".
10+
11+
This change updates the option parsing logic to scan through all arguments to find options, regardless of their position relative to positional arguments. This aligns with the behavior of most CLI tools (git, npm, docker, etc.) which allow options anywhere in the command.
12+
13+
**Before:**
14+
15+
```bash
16+
myapp deploy --force staging # worked
17+
myapp deploy staging --force # failed: "Received unknown argument: '--force'"
18+
```
19+
20+
**After:**
21+
22+
```bash
23+
myapp deploy --force staging # works
24+
myapp deploy staging --force # works
25+
```
26+
327
## 0.73.0
428

529
### Patch Changes

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@effect/cli",
3-
"version": "0.73.0",
3+
"version": "0.73.1",
44
"type": "module",
55
"license": "MIT",
66
"description": "A library for building command-line interfaces with Effect",

0 commit comments

Comments
 (0)