File tree Expand file tree Collapse file tree 8 files changed +36
-22
lines changed Expand file tree Collapse file tree 8 files changed +36
-22
lines changed Original file line number Diff line number Diff line change 11= view_marker
22
33> if [[ -n "$long_usage" ]]; then
4- = render(:usage_options).indent 2
4+ = render(:usage_options).indent 2 if flags.any? || fixed_flags?
55= render(:usage_args).indent 2 if args.any? or catch_all.help
66= render(:usage_environment_variables).indent 2 if environment_variables.any?
77= render(:usage_examples).indent 2 if examples
Original file line number Diff line number Diff line change 11= view_marker
22
3- if flags.any? || fixed_flags?
4- options_caption = strings[:options]
5- if commands.any? && (public_flags.any? || (flags.any? && Settings.private_reveal_key))
6- options_caption = strings[:global_options]
7- end
8-
9- > printf "%s\n" "{{ options_caption.color(:caption) }}"
10- >
11- = render(:usage_flags) if flags.any?
12- = render(:usage_fixed_flags)
3+ options_caption = strings[:options]
4+ if commands.any? && (public_flags.any? || (flags.any? && Settings.private_reveal_key))
5+ options_caption = strings[:global_options]
136end
7+
8+ > printf "%s\n" "{{ options_caption.color(:caption) }}"
9+ >
10+ = render(:usage_flags) if flags.any?
11+ = render(:usage_fixed_flags)
Original file line number Diff line number Diff line change 683683 "description" : " Whether the current argument or flag is required\n https://bashly.dev/configuration/command/#catch_all" ,
684684 "type" : " boolean" ,
685685 "default" : false
686+ },
687+ "catch_help" : {
688+ "description" : " Whether to also disable the --help flag and catch it like any other\n https://bashly.dev/configuration/command/#catch_all" ,
689+ "type" : " boolean" ,
690+ "default" : false
686691 }
687692 },
688693 "additionalProperties" : false
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- # This fixture tests that catch all with help is displayed even when the
4- # configuration file does not have any args defined.
5- # It is executed as part of the Runfile examples test
6- # Reference issue: https://github.com/bashly-framework/bashly/issues/74
7-
83rm -f ./cli
94
105set -x
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- # This fixture tests that catch all with help is displayed even when the
4- # configuration file does not have any args defined.
5- # It is executed as part of the Runfile examples test
6- # Reference issue: https://github.com/bashly-framework/bashly/issues/74
7-
83rm -f ./cli
94
105set -x
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ def examples
88 end
99
1010 def fixtures
11- filter_dirs ( 'spec/fixtures/workspaces' ) . map { |dir | new dir , type : :fixture }
11+ filter_dirs ( 'spec/fixtures/workspaces' )
12+ . select { |dir | File . exist? "#{ dir } /src/bashly.yml" }
13+ . map { |dir | new dir , type : :fixture }
1214 end
1315
1416 def all
Original file line number Diff line number Diff line change 1616help 'Run all the test actions in this runfile'
1717action :all do
1818 check_examples
19+ check_fixtures
1920 check_settings
2021 check_strings
2122 check_arbitrary
@@ -46,6 +47,9 @@ action(:example) { |args| schema_check "examples/#{args['EXAMPLE']}/src/bashly.y
4647help 'Test the bashly schema against all examples'
4748action(:examples) { check_examples }
4849
50+ help 'Test the bashly schema against all workspace fixtures'
51+ action(:fixtures) { check_fixtures }
52+
4953help 'Test the settings schema against the default settings template'
5054action(:settings) { check_settings }
5155
@@ -68,6 +72,15 @@ helpers do
6872 say "\ngub`Examples PASS`"
6973 end
7074
75+ def check_fixtures
76+ say "\ngub`Fixtures`"
77+ Example.fixtures.each do |example|
78+ file = example.yaml_path
79+ schema_check file
80+ end
81+ say "\ngub`Examples PASS`"
82+ end
83+
7184 def check_settings
7285 say "\ngub`Settings schema`"
7386 file = 'lib/bashly/libraries/settings/settings.yml'
Original file line number Diff line number Diff line change @@ -581,6 +581,12 @@ definitions:
581581 https://bashly.dev/configuration/command/#catch_all
582582 type : boolean
583583 default : false
584+ catch_help :
585+ description : |-
586+ Whether to also disable the --help flag and catch it like any other
587+ https://bashly.dev/configuration/command/#catch_all
588+ type : boolean
589+ default : false
584590 additionalProperties : false
585591 completions-property :
586592 title : completions
You can’t perform that action at this time.
0 commit comments