summaryrefslogtreecommitdiff
path: root/src/is_built
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-02 15:33:43 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 20:01:07 -0600
commitca6c84babe7a203978e1b3496a46da6b819d98ca (patch)
tree8d84db946a71845f81bb2866001c470429b3bee2 /src/is_built
parentbeae9b3e2822021fea741fc98282cf9e0fc1d024 (diff)
is_built: document exit codes
Diffstat (limited to 'src/is_built')
-rwxr-xr-xsrc/is_built15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/is_built b/src/is_built
index 6aa9b66..e6797fd 100755
--- a/src/is_built
+++ b/src/is_built
@@ -2,23 +2,28 @@
cmd=${0##*/}
usage() {
- echo "Usage: $cmd pkgname pkgver"
+ echo "Usage: $cmd [-h] pkgname pkgver"
echo
echo "Detect if a given package version is already in repos"
- echo "Assuming you want greater or equal"
+ echo "Assuming you want greater or equal."
echo
echo "Example usage: $cmd 'pcre' '20'"
+ echo
+ echo "Exit status:"
+ echo " 0: The package is built"
+ echo " 1: The package has not built"
+ echo " >1: There was an error"
}
while getopts 'h' arg; do
case $arg in
h) usage; exit 0 ;;
- *) usage >&2; exit 1 ;;
+ *) usage >&2; exit 2 ;;
esac
done
if [[ $# != 2 ]]; then
- usage >&2;
- exit 1
+ usage >&2
+ exit 2
fi
pkg=${1}