Skip to content

Commit a7012e2

Browse files
committed
- Remove unused code for --version and --help in root command
1 parent fb0f513 commit a7012e2

File tree

19 files changed

+9
-104
lines changed

19 files changed

+9
-104
lines changed

examples/colors/colorly

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,7 @@ run() {
173173
declare -A args
174174
parse_requirements "$@"
175175

176-
if [[ ${args[--version]} ]]; then
177-
version_command
178-
elif [[ ${args[--help]} ]]; then
179-
long_usage=yes
180-
colorly_usage
181-
elif [[ $action == "root" ]]; then
176+
if [[ $action == "root" ]]; then
182177
root_command
183178
fi
184179
}

examples/command-default/ftp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,6 @@ run() {
363363
ftp_download_command
364364
fi
365365

366-
elif [[ ${args[--version]} ]]; then
367-
version_command
368-
elif [[ ${args[--help]} ]]; then
369-
long_usage=yes
370-
ftp_usage
371366
elif [[ $action == "root" ]]; then
372367
root_command
373368
fi

examples/command-groups/ftp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,6 @@ run() {
538538
ftp_logout_command
539539
fi
540540

541-
elif [[ ${args[--version]} ]]; then
542-
version_command
543-
elif [[ ${args[--help]} ]]; then
544-
long_usage=yes
545-
ftp_usage
546541
elif [[ $action == "root" ]]; then
547542
root_command
548543
fi

examples/commands-nested/cli

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,6 @@ run() {
790790
cli_file_edit_command
791791
fi
792792

793-
elif [[ ${args[--version]} ]]; then
794-
version_command
795-
elif [[ ${args[--help]} ]]; then
796-
long_usage=yes
797-
cli_usage
798793
elif [[ $action == "root" ]]; then
799794
root_command
800795
fi

examples/commands/cli

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,6 @@ run() {
434434
cli_upload_command
435435
fi
436436

437-
elif [[ ${args[--version]} ]]; then
438-
version_command
439-
elif [[ ${args[--help]} ]]; then
440-
long_usage=yes
441-
cli_usage
442437
elif [[ $action == "root" ]]; then
443438
root_command
444439
fi

examples/config-ini/configly

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,6 @@ run() {
620620
configly_list_command
621621
fi
622622

623-
elif [[ ${args[--version]} ]]; then
624-
version_command
625-
elif [[ ${args[--help]} ]]; then
626-
long_usage=yes
627-
configly_usage
628623
elif [[ $action == "root" ]]; then
629624
root_command
630625
fi

examples/custom-includes/download

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,7 @@ run() {
145145
declare -A args
146146
parse_requirements "$@"
147147

148-
if [[ ${args[--version]} ]]; then
149-
version_command
150-
elif [[ ${args[--help]} ]]; then
151-
long_usage=yes
152-
download_usage
153-
elif [[ $action == "root" ]]; then
148+
if [[ $action == "root" ]]; then
154149
root_command
155150
fi
156151
}

examples/custom-strings/download

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,7 @@ run() {
161161
declare -A args
162162
parse_requirements "$@"
163163

164-
if [[ ${args[--version]} ]]; then
165-
version_command
166-
elif [[ ${args[--help]} ]]; then
167-
long_usage=yes
168-
download_usage
169-
elif [[ $action == "root" ]]; then
164+
if [[ $action == "root" ]]; then
170165
root_command
171166
fi
172167
}

examples/default-values/convert

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,7 @@ run() {
161161
declare -A args
162162
parse_requirements "$@"
163163

164-
if [[ ${args[--version]} ]]; then
165-
version_command
166-
elif [[ ${args[--help]} ]]; then
167-
long_usage=yes
168-
convert_usage
169-
elif [[ $action == "root" ]]; then
164+
if [[ $action == "root" ]]; then
170165
root_command
171166
fi
172167
}

examples/dependencies/cli

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,6 @@ run() {
319319
cli_upload_command
320320
fi
321321

322-
elif [[ ${args[--version]} ]]; then
323-
version_command
324-
elif [[ ${args[--help]} ]]; then
325-
long_usage=yes
326-
cli_usage
327322
elif [[ $action == "root" ]]; then
328323
root_command
329324
fi

0 commit comments

Comments
 (0)