@@ -15,48 +15,60 @@ $ bashly generate
1515## ` bashly.yml `
1616
1717```` yaml
18- name : download
19- help : Sample application to demonstrate the use of conflicting flags
18+ name : cli
19+ help : Sample application to demonstrate the use of needy flags
2020version : 0.1.0
2121
2222flags :
23- - long : --cache
24- help : Enable cache
25- # Running --cache with --no-cache is not permitted
26- conflicts : [--no-cache]
27- - long : --no-cache
28- help : Disable cache
29- # Running --no-cache with --cache or with --fast is not permitted
30- conflicts : [--cache, --fast]
31- - long : --fast
32- help : Run faster
33- # Make sure to add the conflicting flags in both flags
34- conflicts : [--no-cache]
23+ - long : --add
24+ short : -a
25+ arg : alias
26+ help : Alias to add
27+ # When using --add, --command and --target must also be provided
28+ needs : [--command, --target]
29+
30+ - long : --command
31+ short : -c
32+ arg : command
33+ help : Command for the alias
34+ # Note that this relationship is marked on both sides
35+ needs : [--add]
36+
37+ - long : --target
38+ short : -t
39+ arg : target
40+ help : Where to add the alias
41+ needs : [--add]
42+ allowed : [global, local]
3543` ` ` `
3644
3745
3846
3947# # Output
4048
41- # ## `$ ./download -h`
49+ # ## `$ ./cli -h`
4250
4351` ` ` ` shell
44- download - Sample application to demonstrate the use of conflicting flags
52+ cli - Sample application to demonstrate the use of needy flags
4553
4654Usage :
47- download [OPTIONS]
48- download --help | -h
49- download --version | -v
55+ cli [OPTIONS]
56+ cli --help | -h
57+ cli --version | -v
5058
5159Options :
52- --cache
53- Enable cache
60+ --add, -a ALIAS
61+ Alias to add
62+ Needs : --command, --target
5463
55- --no-cache
56- Disable cache
64+ --command, -c COMMAND
65+ Command for the alias
66+ Needs : --add
5767
58- --fast
59- Run faster
68+ --target, -t TARGET
69+ Where to add the alias
70+ Allowed : global, local
71+ Needs : --add
6072
6173 --help, -h
6274 Show this help
@@ -68,21 +80,31 @@ Options:
6880
6981````
7082
71- ### ` $ ./download --cache `
83+ ### ` $ ./cli --add deploy `
7284
7385```` shell
74- # this file is located in 'src/root_command.sh'
75- # you can edit it freely and regenerate (it will not be overwritten)
76- args:
77- - ${args[--cache]} = 1
86+ --add requires --command
87+
88+
89+ ````
90+
91+ ### ` $ ./cli --add deploy --command 'git push' `
92+
93+ ```` shell
94+ --add requires --target
7895
7996
8097````
8198
82- ### ` $ ./download --no-cache --fast `
99+ ### ` $ ./cli --add deploy --command 'git push' --target local `
83100
84101```` shell
85- conflicting options: --fast cannot be used with --no-cache
102+ # this file is located in 'src/root_command.sh'
103+ # you can edit it freely and regenerate (it will not be overwritten)
104+ args:
105+ - ${args[--add]} = deploy
106+ - ${args[--command]} = git push
107+ - ${args[--target]} = local
86108
87109
88110````
0 commit comments