Config::Pit(3pm)
π Config::Pit β the manual page, but make it a group chat π
okay bestie, so this is Config::Pit from the User Contributed Perl Documentation section, and it's literally the library that manages all ur settings so u never have to hardcode a password again. iykyk. β¨
πΈ NAME πΈ
Config::Pit β Manage settings π
π¦ SYNOPSIS π¦
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<require>).
# use $config->{username}, $config->{password}
so like. if the fields aren't set yet, it opens up the setting with $EDITOR for u, prefilled with YAML-dumped default values (the ones u specified at require). then u just use $config->{username} and $config->{password}. slay. π
β¨ DESCRIPTION β¨
Config::Pit is an account setting management library. it literally automates editing the settings ur scripts use, so ur not out here hand-editing config files like it's 2009. π«Ά
the original library is written in Ruby and published as the pit gem, with a management command. iconic ancestry fr fr.
u can install it by rubygems:
$ sudo gem install pit
$ pit set example.com
# open setting of example.com with $EDITOR.
and Config::Pit provides the ppit command, which is the pit command but written in Perl. the glow-up. π
See:
$ ppit help
π FUNCTIONS π
π Config::Pit::get(setting_name, opts)
get the setting named "setting_name" from the current profile. π
my $config = Config::Pit::get("example.com");
this is the exact same as this:
my $config = pit_get("example.com");
opts:
requireβ specify the fields u want as the key, and a hint (description or default value) of that field as the value. like so:
my $config = pit_get("example.com", require => {
"username" => "your username on example.com",
"password" => "your password on example.com"
});
when"require"is specified, the module checks that all the required fields exist in the setting. if they don't exist, it opens the setting with$EDITOR, using a merged setting (the current setting + ur stuff). bestie it will literally hold ur hand. π€
π§ Config::Pit::set(setting_name, opts)
set the setting named "setting_name" to the current profile. πΈ
Config::Pit::set("example.com"); #=> will open setting with $EDITOR
opts:
dataβ
Config::Pit::set("example.com", data => {
username => "foobar",
password => "barbaz",
});
when "data" is specified, it will not open $EDITOR β it just sets the data directly. no editor, no vibe check, straight to business. π₯
configβ
Config::Pit::set("example.com", config => {
username => "config description or default value",
password => "same as above",
});
this one opens $EDITOR with a merged setting (current setting + the config u specified). β¨
π Config::Pit::switch(profile_name);
switch the profile to "profile_name". π¦
a profile is a set of settings. watch the main character energy:
$ 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...
see how it came back to the default? periodt. π
π AUTHOR π
cho45 <cho45@lowreal.net> β the icon, the legend, the moment. π
π LICENSE π
this library is free software; u can redistribute it and/or modify it under the same terms as Perl itself. π
β SEE ALSO β
<http://lowreal.rubyforge.org/pit/>is pit in Ruby. πbin/ppitis the pit command in Perl. πͺ
and that's the whole thing bestie, no cap. this page came from perl v5.36.0, dated 2022-12-07, and honestly? iconic. stay config'd, stay hydrated, and go set ur passwords properly for once. πβ¨ππ¦πΈπ
π«Άππ₯ππβππππ§π
π¦ where this page comes from
- debian bookworm: libconfig-pit-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libconfig-pit-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libconfig-pit-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libconfig-pit-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libconfig-pit-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms