Support separating aliases by space too
FossilOrigin-Name: d43b2b7086552734bd613a9398044e9431fb6eaea16131cd45bb30cb43ab47c4
This commit is contained in:
parent
deb044199f
commit
a0ef512f42
1 changed files with 8 additions and 4 deletions
12
shelldap
12
shelldap
|
|
@ -1578,8 +1578,8 @@ sub run_alias
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
||||||
# If there is argument but without =, user wanted to print specific alias
|
# If there is argument but without = or space, user wanted to print specific alias
|
||||||
} elsif($cmd_alias !~ /=/ and !@_) {
|
} elsif($cmd_alias !~ /[=\s]/ and !@_) {
|
||||||
my $alias = $cmd_alias;
|
my $alias = $cmd_alias;
|
||||||
my $cmd_args = $conf->{alias}{$alias};
|
my $cmd_args = $conf->{alias}{$alias};
|
||||||
unless( $cmd_args) {
|
unless( $cmd_args) {
|
||||||
|
|
@ -1591,9 +1591,13 @@ sub run_alias
|
||||||
|
|
||||||
# There is argument with =, so the line is a new alias definition
|
# There is argument with =, so the line is a new alias definition
|
||||||
} else {
|
} else {
|
||||||
my($alias, $command) = split /=/, $cmd_alias, 2;
|
my($alias, $command) = ($cmd_alias =~ m/^(\S+?)[=\s]?(.*)$/);
|
||||||
|
unless( $alias) {
|
||||||
|
print "Invalid syntax.\n";
|
||||||
|
return
|
||||||
|
}
|
||||||
$command = $cmd_map{$command}[0] if $cmd_map{$command} and $cmd_map{$command}[0];
|
$command = $cmd_map{$command}[0] if $cmd_map{$command} and $cmd_map{$command}[0];
|
||||||
$conf->{alias}{$alias} = [ $command, @_ ];
|
$conf->{alias}{$alias} = [ $command ? $command : (), @_ ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue