# Sample %COMMANDS in the format assumed. %COMMANDS=( add => { Sum => 'add NAME to LIST', Desc => 'Add the name to the mailing list.' }, all => { Sum => 'all [-a|-l]', Desc => 'Print out all the aliases and mailing lists. '. 'With -a only prints aliases, with -l only prints '. 'lists.' }, delete => { Sum => 'delete LIST,...', Desc => 'Delete mailing lists. Also deleted owner-LIST and '. 'LIST-owner if they exist.' }, list => { Sum => 'list [-1|-x|-s|-n] LIST|/regex/,...', Desc => 'List information about the given aliases. If list '. 'name starts with "/" it is assumed to be a regular '. 'expression. '. '-1 lists members one per line, '. '-x lists members all on a single line. '. '-s lists in Unix alias format. '. '-n only shows list names.' }, ); # Usage message sub Help { print "The current commands are:\n"; my $cmd; foreach $cmd (sort keys %COMMANDS) { print _sprintstr($COMMANDS{$cmd}->{Desc}, $COMMANDS{$cmd}->{Sum},30,1)."\n"; } print "Use 'quit' or '^D' to quit.\n"; }