Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub shell : Command('Open shell.') : Fallback {
- my ($application) = @_;
- my $term = new Term::ReadLine;
- my $prompt = $application->rc->{prompt} || 'nexuck>';
- my $shell = new CLI::Application(name => 'nexuck shell');
- while(defined(my $line = $term->readline($prompt . ' '))) {
- my @chunks = split /\s+/, $line;
- eval { $shell->prepare(@chunks) };
- if($@) {
- warn "$@";
- next;
- }
- if($shell->action and $shell->action eq 'shell') {
- warn "You're already in the Nexuck Shell, stupid!\n";
- next;
- }
- $shell->dispatch;
- }
- }
Add Comment
Please, Sign In to add comment