aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuilder/build-fetch22
1 files changed, 22 insertions, 0 deletions
diff --git a/builder/build-fetch b/builder/build-fetch
index 64fe5a2..ea50e61 100755
--- a/builder/build-fetch
+++ b/builder/build-fetch
@@ -1,5 +1,19 @@
#!/usr/bin/env build
+usage()
+{
+cat<<END_OF_USAGE
+usage: ${0##*/} [options] <url>
+
+options:
+
+ -N, --name Return the filename portion of the URL
+ -V, --var Return the variable portion of the URL
+ -h, --help Display this help
+
+END_OF_USAGE
+}
+
build_fetch_clean()
{
for arg in ${BUILD_FETCH_CLEAN}; do
@@ -219,6 +233,14 @@ build_fetch_http()
unset build_fetch_http_file
}
+
+# Look for requests for help "anywhere" in the command line
+for arg; do
+ case "${arg}" in
+ (-h|-help|--help) usage; exit 0;;
+ esac
+done
+
FETCH_ACTION="fetch"
while [ "$#" -gt "0" ]; do
case "${1}" in