Skip to content

Commit

Permalink
Default help
Browse files Browse the repository at this point in the history
  • Loading branch information
jamonholmgren committed Nov 29, 2023
1 parent 65836f7 commit 89c3707
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
First, alias the `qub` command to the following:

```
alias qub="curl -fsSL https://raw.githubusercontent.com/jamonholmgren/qub/main/src/cli.sh | bash -s --"
alias qub="source <(curl -sSL https://raw.githubusercontent.com/jamonholmgren/qub/main/src/cli.sh)"
```

Now, you should be able to run it like so:
Expand Down
40 changes: 21 additions & 19 deletions src/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,6 @@ main() {
return 0
fi

# Help command if provided -h or --help

if [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: qub [command] [options]"
echo ""
echo "Commands:"
echo " create Create a new Qub QB64 web project"
echo " setup-server Set up remote server for deployment (coming soon)"
echo ""
echo "Options:"
echo " -h, --help Show help"
echo " -v, --version Show version number"
echo ""
echo "Examples:"
echo " qub create"
echo ""
return 0
fi

# Create command

if [[ $1 == "create" ]]; then
Expand Down Expand Up @@ -181,6 +162,27 @@ main() {

return 0
fi

# Otherwise, print help

# Help command if provided -h or --help

echo "Usage: qub [command|option]"
echo ""
echo "Commands:"
echo " create Create a new Qub QB64 web project"
echo ""
echo "Options:"
echo " -h, --help Show help"
echo " -v, --version Show version number"
echo ""
echo "Examples:"
echo " qub create"
echo ""
echo "If you need more help, please visit:"
echo " https://github.com/jamonholmgren/qub"
echo ""
return 0
}

main "$@"

0 comments on commit 89c3707

Please sign in to comment.