Test2:...figData(3pm)
π NAME π
Test2::Tools::Command::ConfigData β the config vault for Test2::Tools::Command, no cap
okay so real quick before we dive in: this is the manual page for Test2:...figData(3pm), filed under User Contributed Perl Documentation. yeah the name got chopped off by the terminal, it's giving β¨truncatedβ¨, we're all used to it, moving on π«Ά
β¨ SYNOPSIS β¨
use Test2::Tools::Command::ConfigData;
$value = Test2::Tools::Command::ConfigData->config('foo');
$value = Test2::Tools::Command::ConfigData->feature('bar');
@names = Test2::Tools::Command::ConfigData->config_names;
@names = Test2::Tools::Command::ConfigData->feature_names;
Test2::Tools::Command::ConfigData->set_config(foo => $new_value);
Test2::Tools::Command::ConfigData->set_feature(bar => $new_value);
Test2::Tools::Command::ConfigData->write; # Save changes
look at that, so clean, so readable, we love to see it πΈ
π DESCRIPTION π
bestie, listen. This module is where all the configuration data for the Test2::Tools::Command module lives. That's it, that's the whole job, and it does it iconically π
It also hands you a programmatic interface so you can get or set that configuration data yourself. Very main character of it.
β οΈ BUT. And this is the big one. To actually make changes, you have to have write access to the Test2::Tools::Command::ConfigData module. And also?? You should attempt to understand the repercussions of your actions. Attempt. Understand. The repercussions. π
like, don't just go editing stuff and then be shocked pikachu when things break, okay? π
π METHODS π
π config($name)
You hand it a string argument, it hands you back the value of the configuration item with that name. And if no such item exists? You get undef. That's it. Simple. Slay.
π feature($name)
Same energy, different shelf: you pass a string argument, you get back the value of the feature by that name. No such feature? undef for you, bestie π«Ά
π set_config($name, $value)
Sets the configuration item with the given name to the given value.
Now the tea β on what a value can be: it may be any Perl scalar that will serialize correctly using Data::Dumper. That includes references, objects (usually), and complex data structures. It probably does not include transient things like filehandles or sockets β those are not the vibe, they don't serialize, don't try it π
π set_feature($name, $value)
Sets the feature with the given name to the given boolean value. And the module is so thoughtful because the value gets converted to 0 or 1 automatically. You don't gotta do a thing, it just knows. β¨
π config_names()
Returns a list of all the names of config items currently defined in Test2::Tools::Command::ConfigData.
In scalar context? It gives you the number of items instead. Two moods, one method, obsessed.
π feature_names()
Returns a list of all the names of features currently defined in Test2::Tools::Command::ConfigData.
And yeah, in scalar context it returns the number of features. Consistency is a love language π
π auto_feature_names()
Returns a list of all the names of features whose availability is dynamically determined. In scalar context? The number of such features.
Heads up though: this does not include such features that have later been set to a fixed value. Once you pin a feature down, it's out of this list, periodt. π
π write()
The moment of commitment. This commits any changes from set_config() and set_feature() to disk. πΎπ₯
Requires write access to the Test2::Tools::Command::ConfigData module. No write access, no write. It's in the name, iykyk.
π AUTHOR π
Test2::Tools::Command::ConfigData was automatically created using Module::Build. π€
Module::Build was written by Ken Williams</>, but he holds no authorship claim or copyright claim to the contents of Test2::Tools::Command::ConfigData. So like, credit where it's due but also not where it's not. Respect the boundary bestie π«Ά
okay that's the whole page!! you made it to the end, so proud of you π₯ΉπΈ
this was brought to you by perl v5.36.0, dated 2023-01-15, living under the name Test2:...figData(3pm) because terminals love to truncate. bye bestie, go write some config πβ¨π
π¦ where this page comes from
- debian bookworm: libtest2-tools-command-perl 0.20-2 Β· BSD-3-Clause
- debian trixie: libtest2-tools-command-perl 0.20-2 Β· BSD-3-Clause
- ubuntu noble: libtest2-tools-command-perl 0.20-2 Β· BSD-3-Clause
- ubuntu resolute: libtest2-tools-command-perl 0.20-2 Β· BSD-3-Clause
- ubuntu stonking: libtest2-tools-command-perl 0.20-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms