aboutsummaryrefslogtreecommitdiff
path: root/contrib/kiss-cargolock-urlgen
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/kiss-cargolock-urlgen')
-rwxr-xr-xcontrib/kiss-cargolock-urlgen9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/kiss-cargolock-urlgen b/contrib/kiss-cargolock-urlgen
index a67b374..f9f377a 100755
--- a/contrib/kiss-cargolock-urlgen
+++ b/contrib/kiss-cargolock-urlgen
@@ -2,10 +2,11 @@
# Converts the given Cargo.lock file to static cargo urls
-[ -r "$1" ] || {
- printf 'usage: %s <Cargo.lock file>\n' "${0##*/}"
- exit 1
-}
+case "$1" in
+ -) set -- /dev/stdin ;;
+ '') printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} <Cargo.lock file>" "" \
+ "'-' can be used to read from stdin." ; exit 0
+esac
# Word splitting is intentional
# shellcheck disable=2046