UR::Ob...:Style(3pm)
β¨ NAME β¨
UR::Object::Command::List β bestie, this one fetches and lists objects in different styles. That's the whole job. It's giving "I do one thing and I do it fabulously" π
(this page itself lives under the manual name UR::Ob...:Style(3pm), iykyk β it's the style chapter of the saga π)
πΈ SYNOPSIS πΈ
okay so to actually use this, you subclass it. Periodt:
package MyLister;
use strict;
use warnings;
use above "UR";
class MyLister {
is => 'UR::Object::Command::List',
has => [
# add/modify properties
],
};
1;
That's it, that's the starter pack. Now let's talk about what you can customize π
π«Ά Provided by the Developer π«Ά
these are the knobs you, the developer, get to turn so your end users have a good time. no cap.
π subject_class_name (optional)
So subject_class_name is the class whose objects are gonna get fetched. You can lock this in one of two main ways:
by_the_end_user_on_the_command_line
For this one, do literally nothing π β the end user has to provide it themselves when the command gets run. hands-off queen energy.
by_the_developer_in the_class_declartion
For this one, in the class declaration you add a has key with an arrayref of hashrefs. One of those hashrefs needs to be subject_class_name. Give it this declaration:
class MyFetchAndDo {
is => 'UR::Object::Command::FetchAndDo',
has => [
subject_class_name => {
value => <CLASS NAME>,
is_constant => 1,
},
],
};
note that <CLASS NAME> is a placeholder, bestie β swap in the real class name, don't ship the angle brackets π
π show (optional)
Want to set up defaults for the show property? Easy. Add them like this:
class MyFetchAndDo {
is => 'UR::Object::Command::FetchAndDo',
has => [
show => {
default_value => 'name,age',
},
],
};
so the user just gets name,age out of the box. iconic.
π¦ helps (optional)
This one is for when you wanna overwrite the help_brief, help_synopsis and help_detail methods so you can serve up your own specific help. Very main character of you.
And if you're overwriting the help_detail method specifically β use _filter_doc to grab the filter documentation and usage, then combine it with your own specific help. Don't reinvent the filter docs, that's not the vibe π
π List Styles π
Here's the menu of styles you can list things in:
textcsvhtmlxmlpretty(inprogress)
pretty is marked inprogress in the original, so likeβ¦ it's on its way, be patient, she's still getting ready π§
that's the whole page, bestie! π this was UR::Ob...:Style(3pm) from the User Contributed Perl Documentation, running on perl v5.32.1, dated 2022-01-17. go forth and list your objects in style β¨ππ
π¦ where this page comes from
- debian bookworm: libur-perl 0.470+ds-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libur-perl 0.470+ds-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libur-perl 0.470+ds-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