Skip to content

Commit 105a0f8

Browse files
committed
- Add 'Global options' caption when appropriate
1 parent 0301e27 commit 105a0f8

File tree

10 files changed

+10
-11
lines changed

10 files changed

+10
-11
lines changed

examples/catch-all/src/root_command.sh

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

examples/command-default-force/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ commands:
4646
tester - Sample application that uses the forced default command option
4747

4848
Usage:
49-
tester COMMAND
49+
tester [COMMAND]
5050
tester [COMMAND] --help | -h
5151
tester --version | -v
5252

examples/command-paths/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Commands:
123123
image Image commands
124124
ps List containers
125125

126-
Options:
126+
Global Options:
127127
--debug, -d
128128
Enable debug mode
129129

examples/docker-like/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Commands:
107107
image Image commands
108108
ps List containers
109109

110-
Options:
110+
Global Options:
111111
--debug, -d
112112
Enable debug mode
113113

examples/render-mandoc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ISSUE TRACKER
102102
AUTHORS
103103
Lana Lang.
104104

105-
Version 0.1.0 March 2024 download(1)
105+
Version 0.1.0 April 2024 download(1)
106106

107107

108108
````

lib/bashly/libraries/strings/strings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Usage captions
55
usage: "Usage:"
66
options: "Options:"
7+
global_options: "Global Options:"
78
arguments: "Arguments:"
89
commands: "Commands:"
910
examples: "Examples:"

lib/bashly/views/command/long_usage.gtx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
= view_marker
22

33
> if [[ -n $long_usage ]]; then
4-
> printf "%s\n" "{{ strings[:options].color(:caption) }}"
4+
options_caption = public_commands.any? && public_flags.any? ? strings[:global_options] : strings[:options]
5+
> printf "%s\n" "{{ options_caption.color(:caption) }}"
56
>
67
= render(:usage_flags).indent 2 if public_flags.any?
78
= render(:usage_fixed_flags).indent 2

spec/approvals/examples/command-paths

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Commands:
3232
image Image commands
3333
ps List containers
3434

35-
Options:
35+
Global Options:
3636
--debug, -d
3737
Enable debug mode
3838

spec/approvals/examples/docker-like

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Commands:
3232
image Image commands
3333
ps List containers
3434

35-
Options:
35+
Global Options:
3636
--debug, -d
3737
Enable debug mode
3838

spec/approvals/fixtures/global-flags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Usage:
1414
Commands:
1515
show
1616

17-
Options:
17+
Global Options:
1818
--alpha, -a
1919
Alpha
2020

0 commit comments

Comments
 (0)