Skip to content

Commit 0a262c6

Browse files
committed
- Fix --wrap func generation excess newlines
1 parent 783fc32 commit 0a262c6

File tree

27 files changed

+830
-715
lines changed

27 files changed

+830
-715
lines changed

examples/catch-all-advanced/cli

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ version_command() {
1111
cli_usage() {
1212
if [[ -n $long_usage ]]; then
1313
printf "cli - Sample application\n"
14-
echo
14+
echo
15+
1516
else
1617
printf "cli - Sample application\n"
17-
echo
18+
echo
19+
1820
fi
1921

2022
printf "Usage:\n"
@@ -45,10 +47,12 @@ cli_usage() {
4547
cli_download_usage() {
4648
if [[ -n $long_usage ]]; then
4749
printf "cli download - Download a file\n"
48-
echo
50+
echo
51+
4952
else
5053
printf "cli download - Download a file\n"
51-
echo
54+
echo
55+
5256
fi
5357

5458
printf "Shortcut: d\n"
@@ -72,25 +76,24 @@ cli_download_usage() {
7276
echo
7377
# :command.usage_args
7478
printf "Arguments:\n"
75-
79+
7680
# :argument.usage
7781
echo " SOURCE"
7882
printf " URL to download from\n"
7983
echo
80-
84+
8185
# :argument.usage
8286
echo " TARGET"
8387
printf " Target filename (default: same as source)\n"
8488
echo
85-
86-
89+
8790
echo " AWS PARAMS..."
8891
printf " Additional arguments or flags for AWS CLI\n"
8992
echo
9093

9194
# :command.usage_examples
9295
printf "Examples:\n"
93-
96+
9497
printf " cli download example.com\n"
9598
printf " cli download example.com ./output -f\n"
9699
echo
@@ -102,10 +105,12 @@ cli_download_usage() {
102105
cli_upload_usage() {
103106
if [[ -n $long_usage ]]; then
104107
printf "cli upload - Upload a file\n"
105-
echo
108+
echo
109+
106110
else
107111
printf "cli upload - Upload a file\n"
108-
echo
112+
echo
113+
109114
fi
110115

111116
printf "Shortcut: u\n"
@@ -125,7 +130,7 @@ cli_upload_usage() {
125130

126131
# :command.usage_args
127132
printf "Arguments:\n"
128-
133+
129134
echo " FILES..."
130135
printf " Files to upload\n"
131136
echo
@@ -204,62 +209,62 @@ parse_requirements() {
204209
version_command
205210
exit
206211
;;
207-
212+
208213
--help | -h )
209214
long_usage=yes
210215
cli_usage
211216
exit
212217
;;
213-
218+
214219
esac
215220
# :command.environment_variables_filter
216221
# :command.dependencies_filter
217222
# :command.command_filter
218223
action=$1
219-
224+
220225
case $action in
221226
-* )
222227
;;
223-
228+
224229
download | d )
225230
action="download"
226231
shift
227232
cli_download_parse_requirements "$@"
228233
shift $#
229-
;;
230-
234+
;;
235+
231236
upload | u )
232237
action="upload"
233238
shift
234239
cli_upload_parse_requirements "$@"
235240
shift $#
236-
;;
237-
241+
;;
242+
238243
# :command.command_fallback
239244
* )
240245
cli_usage
241246
exit 1
242247
;;
243-
248+
244249
esac
245250
# :command.required_args_filter
246251
# :command.required_flags_filter
247252
# :command.parse_requirements_while
248253
while [[ $# -gt 0 ]]; do
249254
key="$1"
250255
case "$key" in
251-
256+
252257
-* )
253258
printf "invalid option: %s\n" "$key"
254259
exit 1
255260
;;
256-
261+
257262
* )
258263
# :command.parse_requirements_case
259264
printf "invalid argument: %s\n" "$key"
260265
exit 1
261266
;;
262-
267+
263268
esac
264269
done
265270
# :command.catch_all_filter
@@ -275,13 +280,13 @@ cli_download_parse_requirements() {
275280
version_command
276281
exit
277282
;;
278-
283+
279284
--help | -h )
280285
long_usage=yes
281286
cli_download_usage
282287
exit
283288
;;
284-
289+
285290
esac
286291
# :command.environment_variables_filter
287292
# :command.dependencies_filter
@@ -305,13 +310,12 @@ cli_download_parse_requirements() {
305310
args[--force]=1
306311
shift
307312
;;
308-
309-
313+
310314
-* )
311315
other_args+=("$1")
312316
shift
313317
;;
314-
318+
315319
* )
316320
# :command.parse_requirements_case
317321
if [[ ! ${args[source]} ]]; then
@@ -325,7 +329,7 @@ cli_download_parse_requirements() {
325329
shift
326330
fi
327331
;;
328-
332+
329333
esac
330334
done
331335
# :command.catch_all_filter
@@ -341,13 +345,13 @@ cli_upload_parse_requirements() {
341345
version_command
342346
exit
343347
;;
344-
348+
345349
--help | -h )
346350
long_usage=yes
347351
cli_upload_usage
348352
exit
349353
;;
350-
354+
351355
esac
352356
# :command.environment_variables_filter
353357
# :command.dependencies_filter
@@ -359,18 +363,18 @@ cli_upload_parse_requirements() {
359363
while [[ $# -gt 0 ]]; do
360364
key="$1"
361365
case "$key" in
362-
366+
363367
-* )
364368
other_args+=("$1")
365369
shift
366370
;;
367-
371+
368372
* )
369373
# :command.parse_requirements_case
370374
other_args+=("$1")
371375
shift
372376
;;
373-
377+
374378
esac
375379
done
376380
# :command.catch_all_filter
@@ -417,15 +421,15 @@ run() {
417421
else
418422
cli_download_command
419423
fi
420-
424+
421425
elif [[ $action == "upload" ]]; then
422426
if [[ ${args[--help]} ]]; then
423427
long_usage=yes
424428
cli_upload_usage
425429
else
426430
cli_upload_command
427431
fi
428-
432+
429433
elif [[ $action == "root" ]]; then
430434
root_command
431435
fi

examples/catch-all/download

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ version_command() {
1919
download_usage() {
2020
if [[ -n $long_usage ]]; then
2121
printf "download - Catch All Example\n"
22-
echo
22+
echo
23+
2324
else
2425
printf "download - Catch All Example\n"
25-
echo
26+
echo
27+
2628
fi
2729

2830
printf "Usage:\n"
@@ -43,7 +45,7 @@ download_usage() {
4345

4446
# :command.usage_args
4547
printf "Arguments:\n"
46-
48+
4749
# :argument.usage
4850
echo " MESSAGE"
4951
printf " Message\n"
@@ -106,13 +108,13 @@ parse_requirements() {
106108
version_command
107109
exit
108110
;;
109-
111+
110112
--help | -h )
111113
long_usage=yes
112114
download_usage
113115
exit
114116
;;
115-
117+
116118
esac
117119
# :command.environment_variables_filter
118120
# :command.dependencies_filter
@@ -131,12 +133,12 @@ parse_requirements() {
131133
while [[ $# -gt 0 ]]; do
132134
key="$1"
133135
case "$key" in
134-
136+
135137
-* )
136138
other_args+=("$1")
137139
shift
138140
;;
139-
141+
140142
* )
141143
# :command.parse_requirements_case
142144
if [[ ! ${args[message]} ]]; then
@@ -147,7 +149,7 @@ parse_requirements() {
147149
shift
148150
fi
149151
;;
150-
152+
151153
esac
152154
done
153155
# :command.catch_all_filter

0 commit comments

Comments
 (0)