Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --help usage to install.sh and exit when invalid arg / Update contributing docs #421

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ https://github.com/docker/cli/blob/master/CONTRIBUTING.md

** Make sure all your commits include a signature generated with `git commit -s` **

For additional information on our contributing process, read our contributing
guide https://docs.docker.com/opensource/code/

If this is a bug fix, make sure your description includes "fixes #xxxx", or
"closes #xxxx"

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@ ruling it out in the future.

docker/docker-install is licensed under the Apache License, Version 2.0.
See [LICENSE](LICENSE) for the full license text.

## Contributing

Make sure you have read and understood our [contributing
guidelines](https://github.com/docker/cli/blob/master/CONTRIBUTING.md).

**Make sure all your commits are signed off and include a signature generated
with `git commit -s`.**
17 changes: 17 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ fi

mirror=''
DRY_RUN=${DRY_RUN:-}

# Provide a helpful usage statement when --help or any invalid argument is passed
# to the script. Exit code deliberately not included here as error depends on
# argument provided.
usage() {
echo
echo "USAGE: "
echo " ${0} [--channel <stable|test>] [--mirror <Aliyun|AzureChinaCloud>] [--version <VERSION>] [--dry-run] [--help]"
echo
}

while [ $# -gt 0 ]; do
case "$1" in
--channel)
Expand All @@ -124,8 +135,14 @@ while [ $# -gt 0 ]; do
VERSION="${2#v}"
shift
;;
--help)
usage
exit 0
;;
--*)
echo "Illegal option $1"
usage
exit 1
;;
esac
shift $(( $# > 0 ? 1 : 0 ))
Expand Down