#%Module1.0

##############################################################################
#   Modules Revision 3.0
#   Providing a flexible user environment
#
#   File:		info/%M%
#   Revision:		%I%
#   First Edition:	2017/01/27
#   Last Mod.:		%U%, %G%
#
#   Authors:		Xavier Delaruelle, xavier.delaruelle@cea.fr
#
#   Description:	Testuite modulefile
#   Command:
#   Sub-Command:	module-info command
#
#   Invocation:
#   Result:	%R{
#		}R%
#   Comment:	%C{
#			This modulefile checks the string representations of
#			the current module command returned by the
#			'module-info command' command
#		}C%
#
##############################################################################

proc ModulesHelp { } {
    if { [module-info command help] } {
        puts stderr "help"
    }
}

proc ModulesTest { } {
    if { [module-info command test] } {
        puts stderr "test"
    }
    return 1
}

if { ![module-info mode whatis] } {
    if { [module-info command load] } {
        puts stderr "load"
    }
    if { [module-info command unload] } {
        puts stderr "unload"
    }
    if { [module-info command reload] } {
        puts stderr "reload"
    }
    if { [module-info command source] } {
        puts stderr "source"
    }
    if { [module-info command switch] } {
        puts stderr "switch"
    }
    if { [module-info command display] } {
        puts stderr "display"
    }
    if { [module-info command purge] } {
        puts stderr "purge"
    }
    if { [module-info command restore] } {
        puts stderr "restore"
    }
    if { [module-info command help] } {
        puts stderr "help"
    }
    if { [module-info command test] } {
        puts stderr "test"
    }
} else {
    if { [module-info command whatis] } {
        module-whatis "whatis"
    }
    if { [module-info command search] } {
        module-whatis "search"
    }
}
