Skip to content

Commit 4c71792

Browse files
authored
chore: move show-usage check into main function
1 parent 1789223 commit 4c71792

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

http-cli

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,6 @@ function set_verbose() {
270270
fi
271271
}
272272

273-
# show usage if no arguments supplied
274-
if ((!$#)); then
275-
die "$(usage)"
276-
fi
277-
278273
# pre parse args
279274
function pre_parse_args() {
280275
local arg
@@ -417,6 +412,9 @@ function parse_args() {
417412

418413
# main
419414
function main() {
415+
if ((!$#)); then
416+
die "$(usage)"
417+
fi
420418
pre_parse_args "$@"
421419
parse_args "$@"
422420
if [[ -z "$FULL_URL" ]]; then

0 commit comments

Comments
 (0)