FuncCommand: improve usage and help messages

This commit is contained in:
Pragmatic Software 2019-09-02 10:36:34 -07:00
parent 41d83d1b9b
commit fcd3b6e64d
1 changed files with 5 additions and 1 deletions

View File

@ -86,7 +86,7 @@ sub do_func {
my $func = $self->{pbot}->{interpreter}->shift_arg($stuff->{arglist});
if (not defined $func) {
return "Usage: func <keyword> [arguments]";
return "Usage: func <keyword> [arguments]; see also: func help";
}
if (not exists $self->{funcs}->{$func}) {
@ -106,6 +106,10 @@ sub do_func {
sub func_help {
my ($self, $func) = @_;
if (not length $func) {
return "func: invoke built-in functions; usage: func <keyword> [arguments]; to list available functions: func list";
}
if (not exists $self->{funcs}->{$func}) {
return "No such func '$func'.";
}