#60 names can include dashes or spaces

This commit is contained in:
Ravi Jain 2019-09-28 11:18:23 +05:30
parent d55b5725d4
commit 913d303cb4
2 changed files with 5 additions and 1 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
ARG_REGEX="<[0-9a-zA-Z_]+>"
ARG_REGEX="<[0-9a-zA-Z]+([_-\[[:space:]]]*[0-9a-zA-Z]+)*>"
ARG_DELIMITER="\f"
ARG_DELIMITER_2="\v"

View file

@ -38,6 +38,10 @@ handler::main() {
break
fi
newArg=$(echo "$arg" | sed -e 's/-/_/g;s/ /_/g')
cmd=$(echo "$cmd" | sed "s|<${arg}>|<${newArg}>|g")
arg=$newArg
value="$(arg::pick "$arg" "$cheat" || echo "")"
if [ -z "$value" ]; then
echoerr "Unable to fetch suggestions for '$arg'!"