CLI::F...d::Meta(3pm)
β¨ CLI::Framework::Command::Meta β the whole vibe β¨
okay so bestie, you found it, the manpage for CLI::Framework::Command::Meta (you'll see it chilling as CLI::F...d::Meta(3pm) in your terminal because the header is doing a little truncation moment π
). This is the User Contributed Perl Documentation era and we're about to get into it.
π NAME
CLI::Framework::Command::Meta β it's giving metacommands, aka the app-aware commands that know things π
πΈ DESCRIPTION
So here's the tea. This class is a subclass of CLI::Framework::Command. It defines what we call "metacommands" β commands that are application-aware, which lowkey means they're implicitly aware of every other command registered within the application π¦β¨. Iconic behaviour honestly.
Metacommands come with methods that set and retrieve a reference to the application they're running inside of. They just know where they are. main character energy fr fr.
Now, why does this class even exist as its own separate class? Because β with a few exceptions β commands should be independent of the application they're associated with and should not affect that application. Periodt. That's the rule.
Metacommands are literally the exception to that rule π. So in those exceptional cases, your command inherits from this class instead of CLI::Framework::Command. That's the whole point, no cap.
π¦ WHEN TO BUILD METACOMMANDS VS REGULAR COMMANDS
See tutorial advice on this topic π (yes, that's the whole thing, go read the tutorial bestie)
π METHODS
π get_app() / set_app( $app )
Retrieve or set the application object associated with a metacommand object. That's it, that's the method π«Ά
$app = $command->get_app();
$command->set_app( $app );
Like... get your app, set your app. Balanced. As all things should be β
π SEE ALSO
CLI::Framework::CommandCLI::Framework::Application
ok that's the whole page bestie, you ate that π β¨ go build something iconic with your metacommands
Sign-off cuteness: this page came to you courtesy of perl v5.34.0, dated 2022-06-11 πΈ β old but still serving, fr.
π¦ where this page comes from
- debian bookworm: libcli-framework-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcli-framework-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcli-framework-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcli-framework-perl 0.05-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcli-framework-perl 0.05-2 Β· 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