Convenience wrapper around Git to provide config access routines.
- Perl 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| dist | ||
| lib/Git | ||
| Makefile.PL | ||
| README.md | ||
NAME
Git::Cfg - Module to assist reading git configuration files
VERSION
version 0.8
SYNOPSIS
An example of use might be
use Git::Cfg;
my $cfg = new Git::Cfg( { '_filename'=>'project.gitconfig' } );
$val = $cfg->_get_cfg_var( 'main.flag' );
or equivalent
$val = $cfg->main_flag; # same as above
$val = $cfg->_get_cfg_var( 'othersection.otherflag' );
or equivalent
$val = $cfg->othersection_otherflag;
and for accessing lists
$listref = $cfg->_get_cfg_var_list( 'multipleflags' );
# --get-all defaultsection.multipleflags
$listref = $cfg->_get_cfg_var_list( 'othersection.moreflags' );
and for getting the list of subsections
$arrayref = $cfg->_get_cfg_sections_matching( 'othersection' );
and for accessing whole sections
$hashref = $cfg->_get_cfg_section_hash( 'section_name' [, $initial_hashref ] );
# --get-regexp section.name.*
DESCRIPTION
Git::Cfg is a module to provide a object/method mechanism to obtain the contents of a gitconfig file.
METHODS
- _get_cfg_var
- _get_cfg_var_list
- _get_cfg_sections_matching
- _get_cfg_section_hash
COMPATIBILITY
Git::CfgrequiresGit
AUTHOR
Bernard Quatermass toolsmith@quatermass.co.uk
COPYRIGHT AND LICENSE
This software is copyright (c) 2017,2020,2021 by Bernard Quatermass.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.