Add custom command support with new CustomCommands module
This commit is contained in:
parent
7807ee5ee3
commit
5d879616e8
2 changed files with 28 additions and 0 deletions
|
@ -6,6 +6,7 @@ use Environment::SQLite;
|
|||
use Term::ReadLine;
|
||||
use Cwd;
|
||||
use File::HomeDir;
|
||||
use CustomCommands;
|
||||
$ENV{TERM} = 'xterm-256color' unless exists $ENV{TERM};
|
||||
|
||||
|
||||
|
@ -59,6 +60,11 @@ while (1) {
|
|||
# Skip empty commands
|
||||
next unless length $command;
|
||||
|
||||
# Try custom commands first
|
||||
if (CustomCommands::handle($command)) {
|
||||
next;
|
||||
}
|
||||
|
||||
# Handle cd command specially
|
||||
if ($command =~ /^cd\s*(.*)/) {
|
||||
my $dir = $1 || $ENV{HOME};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue