Skip to content

Commit b92f581

Browse files
Lawri-van-BuelLawri van Buël
authored andcommitted
Restored CLi to work without an Argument.
Added a check that will make the no argument call to this command print the usage as is common with many such Command line tools. Signed-off-by: Lawri van Buël <[email protected]>
1 parent a9f874d commit b92f581

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/hedgedoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ function main() {
413413
esac
414414
}
415415

416+
# Do the usage function of no Command line arguments are given.
417+
if [[ $# -eq 0 [[; then
418+
set -- "help"
419+
fi
420+
416421
# Allow importing funcs without running main by using `source ./bin/hedgedoc --import`
417422
if [[ "${1:-}" != "--import" ]]; then
418423
main "$@" || exit $?

0 commit comments

Comments
 (0)