Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #29 from displague/bare-help
Browse files Browse the repository at this point in the history
add bare commands to offer command help
  • Loading branch information
displague authored Jan 2, 2020
2 parents e635ad1 + 5b410e4 commit fb28984
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clean:
.PHONY: clean

install:
ln -si $(abspath bin/kubectl-crossplane-*) $(INSTALL_DIR)/
ln -si $(abspath bin/kubectl-crossplane*) $(INSTALL_DIR)/
.PHONY: install

uninstall:
Expand Down
28 changes: 28 additions & 0 deletions bin/kubectl-crossplane
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -e

function usage {
echo "Usage: kubectl crossplane [-h|--help] [COMMAND]... [OPTION]... [ARGUMENT]..." >&2
echo "" >&2
echo "Commands:" >&2
echo " stack" >&2
echo " trace" >&2
echo "" >&2
echo "-h, --help: Print usage" >&2
echo "" >&2
}

function check_help {
if [ "${1}" == "-h" -o "${1}" == "--help" ] ; then
usage
exit 1
fi
}

check_help "${1}"

if [[ $# -lt 1 ]] ; then
usage
exit 1
fi
33 changes: 33 additions & 0 deletions bin/kubectl-crossplane-stack
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -e

function usage {
echo "Usage: kubectl crossplane [-h|--help] stack [COMMAND] [OPTION]... [ARGUMENT]..." >&2
echo "" >&2
echo "Commands (Stack):" >&2
echo " build" >&2
echo " generate-install" >&2
echo " init" >&2
echo " install" >&2
echo " list" >&2
echo " publish" >&2
echo " uninstall" >&2
echo "" >&2
echo "-h, --help: Print usage" >&2
echo "" >&2
}

function check_help {
if [ "${1}" == "-h" -o "${1}" == "--help" ] ; then
usage
exit 1
fi
}

check_help "${1}"

if [[ $# -lt 1 ]] ; then
usage
exit 1
fi

0 comments on commit fb28984

Please sign in to comment.