mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
#60 names can include dashes or spaces
This commit is contained in:
parent
d55b5725d4
commit
913d303cb4
2 changed files with 5 additions and 1 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -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'!"
|
||||
|
|
Loading…
Reference in a new issue