summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-18 19:32:40 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-18 19:32:40 -0200
commitd4abd97cfa9d3c49b0bfee826b03b8b03156b216 (patch)
treeed36ddeda2f613892e4575269ec374bfd99b58ea /lib
parent6721dcbac4f17114b11ad957e9059b74eda9e7f4 (diff)
downloadhydra-d4abd97cfa9d3c49b0bfee826b03b8b03156b216.tar.gz
hydra-d4abd97cfa9d3c49b0bfee826b03b8b03156b216.tar.bz2
Initial provision code
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index b349b40..26d03ea 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -129,3 +129,18 @@ function hydra_usage_hydra {
function hydra_usage_hydractl {
echo "Usage: hydractl <command> [arguments]"
}
+
+# Read a parameter from user
+function hydra_read {
+ local input
+ param="$1"
+ default="$2"
+ shift 2
+ read -rep "$* (defaults to $default): " input
+
+ if [ -z "$input" ]; then
+ declare $param=$default
+ else
+ declare $param=$input
+ fi
+}