App-Chained

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

commit 59cd5c8ee00afc8a1b0187096b7a8b8155e99916
Author: nadim khemir <nkh@cpan.org>
Date:   Wed Apr 28 11:41:15 2010 +0200

    CHANGED: removed sub app description verification as it is done dynamically

commit c1d189b2bb39346d3b54aabde3424f76e902a5d6
Author: nadim khemir <nkh@cpan.org>
Date:   Mon Apr 26 08:33:16 2010 +0200

    CHANGED: completion script is output in two part. bash to stderr and perl to stdout
    FIXED: derived class options made part of the completion

commit 252e8679f12ee71a6a545d72f0340acc3dd31c84
Author: nadim khemir <nkh@cpan.org>
Date:   Mon Apr 26 00:28:11 2010 +0200

    ADDED: INITIAL COMMIT

example/test_wrapper.pl  view on Meta::CPAN

					},
					
				options =>
					sub
					{
					my ($self, $command, $arguments) =  @_ ;
					
					use Capture::Tiny qw(capture);
					
					my $runner = $command->{_MODULE_RUNNER} ;
					my ($stdout, $stderr) = 	capture { $runner->($self, $command, ['--dump_options']) };

					return split /\n/, $stdout ;
					},
				},
				
			# code example for code contained in an executable
			test_application =>
				{
				description => 'executable',
				run =>

lib/App/Chained.pm  view on Meta::CPAN


#-------------------------------------------------------------------------------

sub generate_bash_completion
{
	
=head2 [P]generate_bash_completion()

The generated completion is in two parts:

A perl script used to generate  the completion (output on stdout) and a shell script that you must source (output on stderr).

 $> my_app -bash 1> my_app_perl_completion.pl 2> my_app_regiter_completion

Direction about how to use the completion scritp is contained in the generated script.

The completion will work for the top application till a command is input on the command line after that the completion is for the command.

=head3 command specific options

Your sub commands can define an B<options> field. The field should be set to a subroutine reference that returns a string of options the sub command



( run in 1.462 second using v1.01-cache-2.11-cpan-49f99fa48dc )