.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Config::Pit 3pm" .TH Config::Pit 3pm "2022-12-07" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Config::Pit \- Manage settings .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Config::Pit; \& \& my $config = pit_get("example.com", require => { \& "username" => "your username on example", \& "password" => "your password on example" \& }); \& # if the fields are not set, open setting by $EDITOR \& # with YAML\-dumped default values (specified at C). \& \& # use $config\->{username}, $config\->{password} .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Config::Pit is account setting management library. This library automates editing settings used in scripts. .PP Original library is written in Ruby and published as pit gem with management command. .PP You can install it by rubygems: .PP .Vb 3 \& $ sudo gem install pit \& $ pit set example.com \& # open setting of example.com with $EDITOR. .Ve .PP And Config::Pit provides ppit command which is pit command written in Perl. .PP See: .PP .Vb 1 \& $ ppit help .Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "Config::Pit::get(setting_name, opts)" .IX Subsection "Config::Pit::get(setting_name, opts)" Get setting named \f(CW\*(C`setting_name\*(C'\fR from current profile. .PP .Vb 1 \& my $config = Config::Pit::get("example.com"); .Ve .PP This is same as below: .PP .Vb 1 \& my $config = pit_get("example.com"); .Ve .PP opts: .IP "\fBrequire\fR" 4 .IX Item "require" Specify fields you want as key and hint (description or default value) of the field as value. .Sp .Vb 4 \& my $config = pit_get("example.com", require => { \& "username" => "your username on example.com", \& "password" => "your password on example.com" \& }); .Ve .Sp \&\f(CW\*(C`require\*(C'\fR specified, module check the required fields all exist in setting. If not exist, open the setting by \f(CW$EDITOR\fR with merged setting with current setting. .SS "Config::Pit::set(setting_name, opts)" .IX Subsection "Config::Pit::set(setting_name, opts)" Set setting named \f(CW\*(C`setting_name\*(C'\fR to current profile. .PP .Vb 1 \& Config::Pit::set("example.com"); #=> will open setting with $EDITOR .Ve .PP opts: .IP "\fBdata\fR" 4 .IX Item "data" .Vb 4 \& Config::Pit::set("example.com", data => { \& username => "foobar", \& password => "barbaz", \& }); .Ve .Sp When \f(CW\*(C`data\*(C'\fR specified, will not open \f(CW$EDITOR\fR and set the data directly. .IP "\fBconfig\fR" 4 .IX Item "config" .Vb 4 \& Config::Pit::set("example.com", config => { \& username => "config description or default value", \& password => "same as above", \& }); .Ve .Sp Open \f(CW$EDITOR\fR with merged setting with specified config. .SS "Config::Pit::switch(profile_name);" .IX Subsection "Config::Pit::switch(profile_name);" Switch profile to \f(CW\*(C`profile_name\*(C'\fR. .PP Profile is setting set: .PP .Vb 2 \& $ pit get foobar \& # foo bar... \& \& $ pit switch devel \& Switch profile to devel \& \& $ pit get foobar \& # bar baz \& \& $ pit switch \& Switch profile to default \& \& $ pit get foobar \& # foo bar... .Ve .SH "AUTHOR" .IX Header "AUTHOR" cho45 .SH "LICENSE" .IX Header "LICENSE" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" is pit in Ruby. .PP \&\fIbin/ppit\fR is pit command in Perl.