Git::Wrapper::Plus::Support - Determine what versions of things support what
version 0.004011
use Git::Wrapper::Plus::Support; my $support = Git::Wrapper::Plus::Support->new( git => <git::wrapper> ); if ( $support->supports_command( 'for-each-ref' ) ) { } if ( $support->supports_behavior('add-updates-index') ) { }
supports_command
Determines if a given command is supported on the current git.
This works by using a hand-coded table for interesting values by processing git log for git itself.
git log
Returns undef if the status of a command is unknown ( that is, has not been added to the map yet ), 0 if it is not supported, and 1 if it is.
undef
0
1
if ( $supporter->supports_command('for-each-ref') ) ) { ... } else { ... }
See ::Support::Commands for details.
::Support::Commands
supports_behavior
Indicates if a given command behaves in a certain way
Returns undef if the status of a commands behavior is unknown ( that is, has not been added to the map yet ), 0 if it is not supported, and 1 if it is.
if ( $supporter->supports_behavior('add-updates-index') ) ) { ... } else { ... }
See ::Support::Behaviors for details.
::Support::Behaviors
supports_argument
Indicates if a given command accepts a specific argument.
Returns undef if the status of a commands argument is unknown ( that is, has not been added to the map yet ), 0 if it is not supported, and 1 if it is.
if ( $supporter->supports_argument('cat-file','-e') ) ) { ... } else { ... }
See ::Support::Arguments for details.
::Support::Arguments
git
versions
commands
This attribute contains a ::Support::Commands object for data on git command support.
behaviors
This attribute contains a ::Support::Behaviors object for data on git command behavior support.
arguments
This attribute contains a ::Support::Arguments object for data on git command argument support.
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Git::Wrapper::Plus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Wrapper::Plus
CPAN shell
perl -MCPAN -e shell install Git::Wrapper::Plus
For more information on module installation, please visit the detailed CPAN module installation guide.