From 1174ae13fbdae34c1bde67c330d1221088290a60 Mon Sep 17 00:00:00 2001 From: Jeff Cave Date: Tue, 6 Mar 2018 14:50:55 -0500 Subject: [PATCH] removed ability to start an alias name with a - --- goto.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/goto.bash b/goto.bash index 04c6c80..3839848 100644 --- a/goto.bash +++ b/goto.bash @@ -101,8 +101,8 @@ function _goto_register_alias() return fi - if ! [[ $1 =~ ^[a-zA-Z0-9_-]*$ ]]; then - _goto_error "invalid alias - only alphabetic with numbers, hyphens, and underscores" + if ! [[ $1 =~ ^[[:alnum:]][[:alpha:]]+[a-zA-Z0-9_-]*$ ]]; then + _goto_error "invalid alias - only alphabetic with numbers, hyphens, and underscores. Can only start with letters and numbers." return fi