File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 4444if [[ -n " ${help} " ]]
4545then
4646 echo " Aliases Manager" \
47- " \n\nUsage: ${0} [action] [ID] [alias]" \
47+ " \n\nUsage: ${0} [action] [ID] [alias ID ]" \
4848 " \n\nActions:" \
4949 " \n help\t\tShow help information" \
5050 " \n list\t\tList all aliases" \
@@ -141,9 +141,16 @@ case "${action}" in
141141 if [[ -n " ${1} " ]]
142142 then
143143 alias_id=" ${1} "
144+
145+ if ! test ${alias_id} -gt 0
146+ then
147+ echo " Illegal user ID ${alias_id} "
148+ exit 1
149+ fi
150+
144151 shift
145152 else
146- echo " You must specify alias name " \
153+ echo " You must specify alias ID " \
147154 " \nSee '${0} help'"
148155 exit 1
149156 fi
@@ -152,7 +159,7 @@ case "${action}" in
152159 then
153160 alias_id=" $( cut -d ' ' -f 2 <<< " ${alias}" ) "
154161
155- echo " User ID ${user_id} already has an alias ${alias_id} "
162+ echo " User ID ${user_id} is already aliased to ${alias_id} "
156163 exit 1
157164 fi
158165
You can’t perform that action at this time.
0 commit comments