CLI::F...d::Meta(3pm)

πŸ“¦
version 0.05 Β· 2 versions
  • 0.05 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.05 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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::Command
  • CLI::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