From a45b4b5560024c0b9f88f99f41788860eff88bb8 Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Sat, 15 Jun 2024 23:21:29 -0500 Subject: [PATCH 1/5] Exit 1 when illegal option rather than do install Signed-off-by: H Dub <14808878+hdub-tech@users.noreply.github.com> --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 29f98f12..1cad48cb 100755 --- a/install.sh +++ b/install.sh @@ -126,6 +126,7 @@ while [ $# -gt 0 ]; do ;; --*) echo "Illegal option $1" + exit 1 ;; esac shift $(( $# > 0 ? 1 : 0 )) From 0400e6a06a05f146488cbb2e9b2b83778ad894ea Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Sun, 16 Jun 2024 00:30:52 -0500 Subject: [PATCH 2/5] Add --help flag to install.sh and usage function Signed-off-by: H Dub <14808878+hdub-tech@users.noreply.github.com> --- install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install.sh b/install.sh index 1cad48cb..10d463fa 100755 --- a/install.sh +++ b/install.sh @@ -107,6 +107,14 @@ fi mirror='' DRY_RUN=${DRY_RUN:-} + +usage() { + echo + echo "USAGE: " + echo " ${0} [--channel ] [--mirror ] [--version ] [--dry-run] [--help]" + echo +} + while [ $# -gt 0 ]; do case "$1" in --channel) @@ -124,8 +132,13 @@ while [ $# -gt 0 ]; do VERSION="${2#v}" shift ;; + --help) + usage + exit 0 + ;; --*) echo "Illegal option $1" + usage exit 1 ;; esac From eff50e336a1ea79503042128d7272276c2319682 Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:18:02 -0500 Subject: [PATCH 3/5] Comment new function usage() per Coding Style guide Signed-off-by: H Dub <14808878+hdub-tech@users.noreply.github.com> --- install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.sh b/install.sh index 10d463fa..257204c5 100755 --- a/install.sh +++ b/install.sh @@ -108,6 +108,9 @@ 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: " From a1455b685e96a7fcd71ba849861d7a0aa0dbaeed Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:20:26 -0500 Subject: [PATCH 4/5] Remove addt'l info (dead link) from PR template. Main link is widely inclusive of information already. Signed-off-by: H Dub <14808878+hdub-tech@users.noreply.github.com> --- .github/PULL_REQUEST_TEMPLATE.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4e48d5f8..e288db86 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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" From f22bfa99fa1a77dab7576b3874caf3e7a1d3cacc Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:21:26 -0500 Subject: [PATCH 5/5] Promote PR template contributing guidance to visible status on README Signed-off-by: H Dub <14808878+hdub-tech@users.noreply.github.com> --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 8c90aa90..61e80362 100644 --- a/README.md +++ b/README.md @@ -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`.**