Skip to content

Commit

Permalink
denisidoro#60 names can include dashes or spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
engrravijain committed Sep 28, 2019
1 parent d55b572 commit 913d303
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/arg.sh
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
4 changes: 4 additions & 0 deletions src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'!"
Expand Down

0 comments on commit 913d303

Please sign in to comment.