Skip to content

Commit

Permalink
- Add 'Global options' caption when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBen committed Apr 23, 2024
1 parent 0301e27 commit 105a0f8
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 11 deletions.
3 changes: 0 additions & 3 deletions examples/catch-all/src/root_command.sh

This file was deleted.

2 changes: 1 addition & 1 deletion examples/command-default-force/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ commands:
tester - Sample application that uses the forced default command option

Usage:
tester COMMAND
tester [COMMAND]
tester [COMMAND] --help | -h
tester --version | -v

Expand Down
2 changes: 1 addition & 1 deletion examples/command-paths/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Commands:
image Image commands
ps List containers

Options:
Global Options:
--debug, -d
Enable debug mode

Expand Down
2 changes: 1 addition & 1 deletion examples/docker-like/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Commands:
image Image commands
ps List containers

Options:
Global Options:
--debug, -d
Enable debug mode

Expand Down
2 changes: 1 addition & 1 deletion examples/render-mandoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ISSUE TRACKER
AUTHORS
Lana Lang.

Version 0.1.0 March 2024 download(1)
Version 0.1.0 April 2024 download(1)


````
Expand Down
1 change: 1 addition & 0 deletions lib/bashly/libraries/strings/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Usage captions
usage: "Usage:"
options: "Options:"
global_options: "Global Options:"
arguments: "Arguments:"
commands: "Commands:"
examples: "Examples:"
Expand Down
3 changes: 2 additions & 1 deletion lib/bashly/views/command/long_usage.gtx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
= view_marker

> if [[ -n $long_usage ]]; then
> printf "%s\n" "{{ strings[:options].color(:caption) }}"
options_caption = public_commands.any? && public_flags.any? ? strings[:global_options] : strings[:options]
> printf "%s\n" "{{ options_caption.color(:caption) }}"
>
= render(:usage_flags).indent 2 if public_flags.any?
= render(:usage_fixed_flags).indent 2
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/examples/command-paths
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Commands:
image Image commands
ps List containers

Options:
Global Options:
--debug, -d
Enable debug mode

Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/examples/docker-like
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Commands:
image Image commands
ps List containers

Options:
Global Options:
--debug, -d
Enable debug mode

Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/fixtures/global-flags
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Usage:
Commands:
show

Options:
Global Options:
--alpha, -a
Alpha

Expand Down

0 comments on commit 105a0f8

Please sign in to comment.