Skip to content

Commit db23575

Browse files
committed
- Update flag usage to show its conflicts and needs
1 parent 253af5f commit db23575

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

lib/bashly/libraries/strings/strings.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ required: "(required)"
1818
repeatable: "(repeatable)"
1919
default: "Default: %{value}"
2020
allowed: "Allowed: %{values}"
21+
needs: "Needs: %{values}"
22+
conflicts: "Conflicts: %{values}"
2123

2224
# Fixed flags help text
2325
help_flag_text: Show this help

lib/bashly/views/flag/usage.gtx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,13 @@ if default
1515
end
1616
end
1717

18+
if needs
19+
> printf " {{ strings[:needs] % { values: needs.join(', ') } }}\n"
20+
end
21+
22+
if conflicts
23+
> printf " {{ strings[:conflicts] % { values: conflicts.join(', ') } }}\n"
24+
end
25+
1826
> echo
1927
>

schemas/strings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@
102102
"minLength": 1,
103103
"default": "Allowed: %{values}"
104104
},
105+
"needs": {
106+
"title": "needs",
107+
"description": "The string template for the list of needed flags\nhttps://bashly.dannyb.co/advanced/strings/#custom-strings",
108+
"type": "string",
109+
"minLength": 1,
110+
"default": "Needs: %{values}"
111+
},
112+
"conflicts": {
113+
"title": "conflicts",
114+
"description": "The string template for the list of conflicting flags\nhttps://bashly.dannyb.co/advanced/strings/#custom-strings",
115+
"type": "string",
116+
"minLength": 1,
117+
"default": "Conflicts: %{values}"
118+
},
105119
"help_flag_text": {
106120
"title": "help flag text",
107121
"description": "The help message for --help\nhttps://bashly.dannyb.co/advanced/strings/#custom-strings",

0 commit comments

Comments
 (0)