-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #560 from DannyBen/fix/conflicts-fixed-flags
Fix `conflicts` in fixed flags
- Loading branch information
Showing
10 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
+ bundle exec bashly generate | ||
creating user files in src | ||
created src/test_command.sh | ||
created ./cli | ||
run ./cli --help to test your bash script | ||
+ ./cli | ||
cli | ||
|
||
Usage: | ||
cli [OPTIONS] COMMAND | ||
cli [COMMAND] --help | -h | ||
cli --version | -v | ||
|
||
Commands: | ||
test | ||
|
||
+ ./cli --fast --slow | ||
conflicting options: --slow cannot be used with --fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cli | ||
src/*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This fixture tests that flags with `conflicts` work properly when defined | ||
in a "fixed flags" context (i.e., when both flags and commands are defined). | ||
Reference issue: https://github.com/DannyBen/bashly/issues/559 |
13 changes: 13 additions & 0 deletions
13
spec/fixtures/workspaces/conflicts-fixed-flags/src/bashly.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: cli | ||
version: 0.1.0 | ||
|
||
flags: | ||
- long: --fast | ||
short: -f | ||
conflicts: [--slow] | ||
- long: --slow | ||
short: -s | ||
conflicts: [--fast] | ||
|
||
commands: | ||
- name: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
rm -f ./cli | ||
rm -f ./src/*.sh | ||
|
||
set -x | ||
|
||
bundle exec bashly generate | ||
|
||
./cli | ||
./cli --fast --slow |