Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action: added UnlessF #1041

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions action.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,18 @@ func (a Action) UniqueListF(divider string, f func(s string) string) Action {
})
}

// Unless skips invokation if given condition succeeds.
func (a Action) Unless(condition func(c Context) bool) Action {
// Unless skips invokation if given condition is true.
func (a Action) Unless(condition bool) Action {
return ActionCallback(func(c Context) Action {
if condition {
return ActionValues()
}
return a
})
}

// UnlessF skips invokation if given condition returns true.
func (a Action) UnlessF(condition func(c Context) bool) Action {
return ActionCallback(func(c Context) Action {
if condition(c) {
return ActionValues()
Expand Down
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- [UniqueList](./carapace/action/uniqueList.md)
- [UniqueListF](./carapace/action/uniqueListF.md)
- [Unless](./carapace/action/unless.md)
- [UnlessF](./carapace/action/unlessF.md)
- [Usage](./carapace/action/usage.md)
- [UsageF](./carapace/action/usageF.md)
- [InvokedAction](./carapace/invokedAction.md)
Expand Down
118 changes: 58 additions & 60 deletions docs/src/carapace/action/unless.cast

Large diffs are not rendered by default.

28 changes: 18 additions & 10 deletions docs/src/carapace/action/unless.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
# Unless

[`Unless`] skips invokation if given [condition] succeeds.
[`Unless`] skips invokation if given condition is `true`.

```go
carapace.ActionValues(
"./local",
"~/home",
"/abs",
"one",
"two",
"three",
).Unless(condition.CompletingPath)
carapace.ActionMultiPartsN(":", 2, func(c carapace.Context) carapace.Action {
switch len(c.Parts) {
case 0:
return carapace.ActionValues("true", "false").Suffix(":")
default:
return carapace.Batch(
carapace.ActionValues(
"yes",
"positive",
).Unless(c.Parts[0] != "true"),
carapace.ActionValues(
"no",
"negative",
).Unless(c.Parts[0] != "false"),
).ToA()
}
})
```

![](./unless.cast)

[`Unless`]:https://pkg.go.dev/github.com/carapace-sh/carapace#Action.Unless
[condition]:https://pkg.go.dev/github.com/carapace-sh/carapace/pkg/condition
59 changes: 59 additions & 0 deletions docs/src/carapace/action/unlessF.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{"version": 2, "width": 80, "height": 12, "timestamp": 1726929444, "env": {"SHELL": "elvish", "TERM": "tmux-256color"}}
[0.2044, "o", "\u001b[?7h\u001b[7m⏎\u001b[m \r \r\u001b[?7l\u001b[?2004h"]
[0.20511, "o", "\u001b[?25l\r???> ???> \r\u001b[5C\u001b[?25h\u001b[?25l\r\u001b[5C\u001b[K\r\u001b[5C\u001b[?25h"]
[0.223458, "o", "\u001b[?25l\r\r\u001b[5C\u001b[?25h\u001b[?25l\r\r\u001b[5C\u001b[?25h"]
[0.22353, "o", "\u001b[?25l\r\u001b[K\u001b[0;1;36m~\u001b[0;m \r\n\u001b[0;1;37mesh\u001b[0;m \u001b[0;1;32m❯\u001b[0;m \r\u001b[6C\u001b[?25h"]
[0.602139, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[6C\u001b[0;31me\u001b[0;m\r\u001b[7C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[7C\u001b[?25h"]
[0.602641, "o", "\u001b[?25l\u001b[1A\r\r\n\r\u001b[7C\u001b[?25h"]
[0.615016, "o", "\u001b[?25l\u001b[1A\r\r\n\r\u001b[7C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[7C\u001b[?25h"]
[0.615168, "o", "\u001b[?25l\u001b[1A\r\r\n\r\u001b[7C\u001b[?25h"]
[1.100985, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[7C\u001b[0;31mx\u001b[0;m\r\u001b[8C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[8C\u001b[?25h"]
[1.218184, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[6C\u001b[K\u001b[0;32mexa\u001b[0;m\r\u001b[9C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[9C\u001b[?25h"]
[1.33266, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[6C\u001b[K\u001b[0;31mexam\u001b[0;m\r\u001b[10C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[10C\u001b[?25h"]
[1.397167, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[10C\u001b[0;31mp\u001b[0;m\r\u001b[11C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[11C\u001b[?25h"]
[1.514046, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[11C\u001b[0;31ml\u001b[0;m\r\u001b[12C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[12C\u001b[?25h"]
[1.628261, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[6C\u001b[K\u001b[0;32mexample\u001b[0;m\r\u001b[13C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[13C\u001b[?25h"]
[1.729894, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[13C \r\u001b[14C\u001b[?25h"]
[1.730018, "o", "\u001b[?25l\u001b[1A\r\r\n\r\u001b[14C\u001b[?25h"]
[2.24433, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[14Cm\r\u001b[15C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[15C\u001b[?25h"]
[2.301778, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[15Co\r\u001b[16C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[16C\u001b[?25h"]
[2.428727, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[16Cdifier \r\u001b[23C\u001b[?25h"]
[2.837409, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[23C-\r\u001b[24C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[24C\u001b[?25h"]
[2.981529, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[24C-\r\u001b[25C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[25C\u001b[?25h"]
[3.569226, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[23C\u001b[K\u001b[0;4m--batch \r\n\u001b[0;1;37;45m COMPLETING argument \u001b[0;m \r\n\u001b[0;7;34m--batch\u001b[0;2;7m (Batch()) \u001b[0;m --help\u001b[0;2m (help for modifier) \r\n\u001b[0;34m--cache\u001b[0;2m (Cache()) \u001b[0;m \u001b[0;34m--invoke\u001b[0;2m (Invoke()) \r\n\u001b[0;34m--cache-key\u001b[0;2m (Cache()) \u001b[0;m \u001b[0;34m--list\u001b[0;2m (List()) \r\n\u001b[0;34m--chdir\u001b[0;2m (Chdir()) \u001b[0;m \u001b[0;34m--multiparts\u001b[0;2m (MultiParts()) \r\n\u001b[0;34m--chdirf\u001b[0;2m (ChdirF()) \u001b[0;m \u001b[0;34m--multipartsp\u001b[0;2m (MultiPartsP()) \r\n\u001b[0;34m--filter\u001b[0;2m (Filter()) \u001b[0;m \u001b[0;34m--nospace\u001b[0;2m (NoSpace()) \r\n\u001b[0;34m--filterargs\u001b[0;2m (FilterArgs()) \u001b[0;m \u001b[0;33m--persistentFlag\u001b[0;2m (Help message for persistentFlag\r\n\u001b[0;34m--filterparts\u001b[0;2m (FilterParts())\u001b[0;m \u001b[0;34m--persistentFlag2\u001b[0;2m (Help message for persistentFla\r\n\u001b[0;7;35m \u001b[0;35m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0;m\u001b[9A\r\u001b[22C\u001b[?25h"]
[3.632282, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[25C\u001b[K\u001b[0;4mmultiparts \r\n\u001b[22C\u001b[0;mu\r\n\u001b[2C\u001b[K\u001b[0;7;34mmultiparts\u001b[0;2;7m (MultiParts()) \u001b[0;m \u001b[0;34m--uniquelist\u001b[0;2m (UniqueList()) \r\n\u001b[2C\u001b[0;m\u001b[K\u001b[0;34mmultipartsp\u001b[0;2m (MultiPartsP())\u001b[0;m \u001b[0;34m--uniquelistf\u001b[0;2m (UniqueListF())\r\n\u001b[2C\u001b[0;m\u001b[K\u001b[0;34msuffix\u001b[0;2m (Suffix()) \u001b[0;m \u001b[0;34m--unless\u001b[0;2m (Unless()) \r\n\u001b[2C\u001b[0;m\u001b[K\u001b[0;34msuppress\u001b[0;2m (Suppress()) \u001b[0;m \u001b[0;34m--unlessf\u001b[0;2m (UnlessF()) \r\n\u001b[2C\u001b[0;m\u001b[K\u001b[0;34mtimeout\u001b[0;2m (Timeout()) \u001b[0;m \u001b[0;34m--usage\u001b[0;2m (Usage()) \u001b[0;m\r\n\u001b[J\u001b[A\u001b[5A\r\u001b[23C\u001b[?25h"]
[4.33225, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[25C\u001b[K\u001b[0;4muniquelist \r\n\u001b[23C\u001b[0;mn\r\n\u001b[2C\u001b[K\u001b[0;7;34muniquelist\u001b[0;2;7m (UniqueList()) \u001b[0;m \u001b[0;34m--unless\u001b[0;2m (Unless()) \r\n\u001b[2C\u001b[0;m\u001b[K\u001b[0;34muniquelistf\u001b[0;2m (UniqueListF())\u001b[0;m \u001b[0;34m--unlessf\u001b[0;2m (UnlessF())\u001b[0;m\r\n\u001b[J\u001b[A\u001b[2A\r\u001b[24C\u001b[?25h"]
[4.33239, "o", "\u001b[?25l\u001b[2A\r\r\n\r\n\r\n\r\n\u001b[2A\r\u001b[24C\u001b[?25h"]
[4.466069, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[27C\u001b[K\u001b[0;4mless \r\n\u001b[24C\u001b[0;ml\r\n\u001b[4C\u001b[K\u001b[0;7;34mless\u001b[0;2;7m (Unless())\u001b[0;m \u001b[0;34m--unlessf\u001b[0;2m (UnlessF())\u001b[0;m\r\n\u001b[J\u001b[A\u001b[1A\r\u001b[25C\u001b[?25h"]
[4.466185, "o", "\u001b[?25l\u001b[2A\r\r\n\r\n\r\n\u001b[1A\r\u001b[25C\u001b[?25h"]
[5.108758, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[31C\u001b[K\u001b[0;4mf \r\n\r\n\u001b[0;m\u001b[K\u001b[0;34m--unless\u001b[0;2m (Unless())\u001b[0;m \u001b[0;7;34m--unlessf\u001b[0;2;7m (UnlessF())\u001b[0;m\u001b[1A\r\u001b[25C\u001b[?25h"]
[5.530079, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[23C\u001b[K--unlessf \r\n\u001b[J\u001b[A\r\u001b[33C\u001b[?25h"]
[5.530333, "o", "\u001b[?25l\u001b[1A\r\r\n\r\u001b[33C\u001b[?25h"]
[5.948117, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C\u001b[0;4m./local \r\n\u001b[0;1;37;45m COMPLETING argument \u001b[0;m \r\n\u001b[0;7m./local\u001b[0;m /abs one three two ~/home\u001b[1A\r\u001b[22C\u001b[?25h"]
[5.948485, "o", "\u001b[?25l\u001b[2A\r\r\n\r\n\r\n\u001b[1A\r\u001b[22C\u001b[?25h"]
[5.948949, "o", "\u001b[?25l\u001b[2A\r\r\n\r\n\r\n\u001b[1A\r\u001b[22C\u001b[?25h"]
[5.949151, "o", "\u001b[?25l\u001b[2A\r\r\n\r\n\r\n\u001b[1A\r\u001b[22C\u001b[?25h"]
[7.585602, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[33C\u001b[K\r\n\u001b[J\u001b[A\r\u001b[33C\u001b[?25h"]
[8.093878, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C/\r\u001b[34C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[34C\u001b[?25h"]
[8.279985, "o", "\u001b[?25l\u001b[1A\r\u001b[0;2musage: \u001b[0;mUnlessF()\u001b[K\r\n\u001b[0;31merror:\u001b[0;m no candidates\u001b[K\r\n\u001b[K\u001b[0;1;36m~\u001b[0;m \r\n\u001b[0;1;37mesh\u001b[0;m \u001b[0;1;32m❯\u001b[0;m \u001b[0;32mexample\u001b[0;m modifier --unlessf /\r\u001b[34C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[34C\u001b[?25h"]
[8.938739, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C\u001b[K\r\u001b[33C\u001b[?25h"]
[9.277511, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C~\r\u001b[34C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[34C\u001b[?25h"]
[9.596644, "o", "\u001b[?25l\u001b[1A\r\u001b[0;2musage: \u001b[0;mUnlessF()\u001b[K\r\n\u001b[0;31merror:\u001b[0;m no candidates\u001b[K\r\n\u001b[K\u001b[0;1;36m~\u001b[0;m \r\n\u001b[0;1;37mesh\u001b[0;m \u001b[0;1;32m❯\u001b[0;m \u001b[0;32mexample\u001b[0;m modifier --unlessf ~\r\u001b[34C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[34C\u001b[?25h"]
[10.345352, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C\u001b[K\r\u001b[33C\u001b[?25h"]
[10.58072, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C.\r\u001b[34C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[34C\u001b[?25h"]
[10.648674, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[34C/\r\u001b[35C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[35C\u001b[?25h"]
[10.777515, "o", "\u001b[?25l\u001b[1A\r\u001b[0;2musage: \u001b[0;mUnlessF()\u001b[K\r\n\u001b[0;31merror:\u001b[0;m no candidates\u001b[K\r\n\u001b[K\u001b[0;1;36m~\u001b[0;m \r\n\u001b[0;1;37mesh\u001b[0;m \u001b[0;1;32m❯\u001b[0;m \u001b[0;32mexample\u001b[0;m modifier --unlessf ./\r\u001b[35C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[35C\u001b[?25h"]
[11.741015, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[34C\u001b[K\r\u001b[34C\u001b[?25h"]
[12.268904, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C\u001b[K\r\u001b[33C\u001b[?25h"]
[12.359171, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33Ct\r\u001b[34C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[34C\u001b[?25h"]
[12.522386, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[33C\u001b[K\u001b[0;4mthree \r\n\u001b[0;1;37;45m COMPLETING argument \u001b[0;m \r\n\u001b[0;7mthree\u001b[0;m two\u001b[1A\r\u001b[22C\u001b[?25h"]
[13.289741, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[34C\u001b[K\u001b[0;4mwo \r\n\r\n\u001b[0;m\u001b[Kthree \u001b[0;7mtwo\u001b[0;m\u001b[1A\r\u001b[22C\u001b[?25h"]
[13.78906, "o", "\u001b[?25l\u001b[2A\r\r\n\u001b[33C\u001b[Ktwo \r\n\u001b[J\u001b[A\r\u001b[37C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[37C\u001b[?25h"]
[15.213421, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[6C\u001b[K\r\u001b[6C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[6C\u001b[?25h"]
[15.215373, "o", "\u001b[?25l\u001b[1A\r\r\n\r\u001b[6C\u001b[?25h"]
[15.246035, "o", "\u001b[?25l\u001b[1A\r\r\n\r\u001b[6C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[6C\u001b[?25h"]
[15.644121, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[6C\u001b[0;31me\u001b[0;m\r\u001b[7C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[7C\u001b[?25h"]
[15.85989, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[7C\u001b[0;31mx\u001b[0;m\r\u001b[8C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[8C\u001b[?25h"]
[16.050456, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[8C\u001b[0;31mi\u001b[0;m\r\u001b[9C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[9C\u001b[?25h"]
[16.115359, "o", "\u001b[?25l\u001b[1A\r\r\n\u001b[6C\u001b[K\u001b[0;32mexit\u001b[0;m\r\u001b[10C\u001b[?25h\u001b[?25l\u001b[1A\r\r\n\r\u001b[10C\u001b[?25h"]
[16.339424, "o", "\u001b[?25l\u001b[1A\r\r\n\r\n\r\u001b[?25h\u001b[?7h\u001b[?2004l\r"]
19 changes: 19 additions & 0 deletions docs/src/carapace/action/unlessF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# UnlessF

[`UnlessF`] skips invokation if given [condition] returns `true`.

```go
carapace.ActionValues(
"./local",
"~/home",
"/abs",
"one",
"two",
"three",
).UnlessF(condition.CompletingPath)
```

![](./unlessF.cast)

[`UnlessF`]:https://pkg.go.dev/github.com/carapace-sh/carapace#Action.UnlessF
[condition]:https://pkg.go.dev/github.com/carapace-sh/carapace/pkg/condition
22 changes: 20 additions & 2 deletions example/cmd/modifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func init() {
modifierCmd.Flags().String("uniquelist", "", "UniqueList()")
modifierCmd.Flags().String("uniquelistf", "", "UniqueListF()")
modifierCmd.Flags().String("unless", "", "Unless()")
modifierCmd.Flags().String("unlessf", "", "UnlessF()")
modifierCmd.Flags().String("usage", "", "Usage()")

rootCmd.AddCommand(modifierCmd)
Expand Down Expand Up @@ -266,14 +267,31 @@ func init() {
}).UniqueListF(",", func(s string) string {
return strings.SplitN(s, ":", 2)[0]
}),
"unless": carapace.ActionValues(
"unless": carapace.ActionMultiPartsN(":", 2, func(c carapace.Context) carapace.Action {
switch len(c.Parts) {
case 0:
return carapace.ActionValues("true", "false").Suffix(":")
default:
return carapace.Batch(
carapace.ActionValues(
"yes",
"positive",
).Unless(c.Parts[0] != "true"),
carapace.ActionValues(
"no",
"negative",
).Unless(c.Parts[0] != "false"),
).ToA()
}
}),
"unlessf": carapace.ActionValues(
"./local",
"~/home",
"/abs",
"one",
"two",
"three",
).Unless(condition.CompletingPath),
).UnlessF(condition.CompletingPath),
"usage": carapace.ActionValues().Usage("explicit usage"),
})

Expand Down
41 changes: 31 additions & 10 deletions example/cmd/modifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,32 +463,53 @@ func TestSplitP(t *testing.T) {
Usage("SplitP()"))
})
}

func TestUnless(t *testing.T) {
sandbox.Package(t, "github.com/carapace-sh/carapace/example")(func(s *sandbox.Sandbox) {
s.Run("modifier", "--unless", "").
s.Run("modifier", "--unless", "true:").
Expect(carapace.ActionValues(
"yes",
"positive",
).Prefix("true:").
NoSpace(':').
Usage("Unless()"))

s.Run("modifier", "--unless", "false:").
Expect(carapace.ActionValues(
"no",
"negative",
).Prefix("false:").
NoSpace(':').
Usage("Unless()"))
})
}

func TestUnlessF(t *testing.T) {
sandbox.Package(t, "github.com/carapace-sh/carapace/example")(func(s *sandbox.Sandbox) {
s.Run("modifier", "--unlessf", "").
Expect(carapace.ActionValues(
"./local",
"~/home",
"/abs",
"one",
"two",
"three",
).Usage("Unless()"))
).Usage("UnlessF()"))

s.Run("modifier", "--unless", "t").
s.Run("modifier", "--unlessf", "t").
Expect(carapace.ActionValues(
"two",
"three",
).Usage("Unless()"))
).Usage("UnlessF()"))

s.Run("modifier", "--unless", ".").
Expect(carapace.ActionValues().Usage("Unless()"))
s.Run("modifier", "--unlessf", ".").
Expect(carapace.ActionValues().Usage("UnlessF()"))

s.Run("modifier", "--unless", "~").
Expect(carapace.ActionValues().Usage("Unless()"))
s.Run("modifier", "--unlessf", "~").
Expect(carapace.ActionValues().Usage("UnlessF()"))

s.Run("modifier", "--unless", "/").
Expect(carapace.ActionValues().Usage("Unless()"))
s.Run("modifier", "--unlessf", "/").
Expect(carapace.ActionValues().Usage("UnlessF()"))
})
}

Expand Down