mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
Fix module sub-command abbreviation match to ensure passed abbreviated form fully match sub-command, not only its minimal abbreviated form. As an example, ``lod`` or ``loda`` do not match anymore the ``load`` sub-command, ``lo`` or ``loa`` still do.
54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
##############################################################################
|
|
# Modules Revision 3.0
|
|
# Providing a flexible user environment
|
|
#
|
|
# File: modules.00-init/%M%
|
|
# Revision: %I%
|
|
# First Edition: 2016/08/20
|
|
# Last Mod.: %U%, %G%
|
|
#
|
|
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr
|
|
#
|
|
# Description: Testuite testsequence
|
|
# Command:
|
|
# Sub-Command:
|
|
#
|
|
# Comment: %C{
|
|
# Check command line commands with a bad command name.
|
|
# }C%
|
|
#
|
|
##############################################################################
|
|
|
|
#
|
|
# The following answers are to be expected in this testcase ...
|
|
#
|
|
|
|
set bad_arg "$error_msgs: Invalid command "
|
|
|
|
|
|
#
|
|
# The tests
|
|
#
|
|
|
|
if { $verbose > 0 } {
|
|
send_user "\tChecking command line commands ...\n"
|
|
}
|
|
|
|
# invalid command leads to error code
|
|
testouterr_cmd ALL foobar ERR "$bad_arg'foobar'\n$err_typehelp"
|
|
|
|
# bad sub-command abbreviation
|
|
testouterr_cmd sh lob ERR "$bad_arg'lob'\n$err_typehelp"
|
|
testouterr_cmd sh unlob ERR "$bad_arg'unlob'\n$err_typehelp"
|
|
testouterr_cmd sh loada ERR "$bad_arg'loada'\n$err_typehelp"
|
|
testouterr_cmd sh lista ERR "$bad_arg'lista'\n$err_typehelp"
|
|
testouterr_cmd sh aval ERR "$bad_arg'aval'\n$err_typehelp"
|
|
testouterr_cmd sh a ERR "$bad_arg'a'\n$err_typehelp"
|
|
|
|
|
|
#
|
|
# Clean up variables used in this test case
|
|
#
|
|
|
|
unset bad_arg
|