diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-11-18 19:32:40 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-11-18 19:32:40 -0200 |
commit | d4abd97cfa9d3c49b0bfee826b03b8b03156b216 (patch) | |
tree | ed36ddeda2f613892e4575269ec374bfd99b58ea /lib | |
parent | 6721dcbac4f17114b11ad957e9059b74eda9e7f4 (diff) | |
download | hydra-d4abd97cfa9d3c49b0bfee826b03b8b03156b216.tar.gz hydra-d4abd97cfa9d3c49b0bfee826b03b8b03156b216.tar.bz2 |
Initial provision code
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hydra/misc | 15 |
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 +} |