LrCommand(3pm)
π LrCommand β bestie edition π
okay so this is LrCommand(3pm) from LogReport's Lire Documentation, and it's literally the blueprint for building command line programs that all share the same vibes. main character base-class energy, no cap. π
β¨ NAME β¨
Lire::LrCommand β the base class for command line programs. it's giving "everyone else inherits from me" π
πΈ SYNOPSIS πΈ
my $prog = new Lire::LrCommand();
$prog->init();
$prog->add_section( 'myprog', __( 'My Program Options' ) );
$prog->add_option( 'name' => 'myoption', 'type' => '=s',
'help' => __( 'My option help.' ) );
$prog->add_common_options();
$prog->parse_options();
like, that's the whole glow-up routine right there π
π¦ DESCRIPTION π¦
so this class exists so you can build command line programs that share functionality β aka they all get the same cute little toolkit instead of everyone reinventing the wheel. teamwork, slay. π«Ά
β METHODS β
π new( [$usage], [$help] )
creates a fresh new Lire::LrCommon instance. it initializes the usage string and the help message to $usage and $help respectively. newborn program, iconic. β¨
π set_usage( [$usage] )
π set_help( [$help] )
π set_section( [$name], [$label] )
π add_option( [%args] )
π add_common_options()
(yes bestie, they're listed just like this β go read the source for the deets, i'm not out here inventing lore π)
π import_log( [$converter], [$logfile] )
import_log invokes Lire::ImportJob and Lire::DlfConverterProcess. it uses &handle_logfile.
β οΈ okay this part matters so listen up: if the$logfileis compressed, it gets decompressed to a file in$TMPDIR. and if the$logfileis read from a pipe or fromSTDIN, it gets written to a file in$TMPDIR. so if you're short on discspace, pass the logfile as an uncompressed file. your disk will thank you ππ
π generate_report( [$converter], [$logfile] )
generates a report from a $logfile, using $converter. returns $reportfile. it uses Lire::ReportConfig::generate_report to do the actual real work β delegation is self-care, periodt. π₯
π SEE ALSO π
lr_log2report(1)lr_log2mail(1)lr_xml2mail(1)lr_xml2report(1)Lire::Config(3pm)Lire::ReportConfig(3pm)Lire::PluginManager(3pm)Lire::DlfStore(3pm)Lire::ImportJob(3pm)Lire::OutputJob(3pm)Lire::DlfConverterProcess(3pm)
go read the whole friend group, iykyk π
π AUTHOR π
Francis J. Lacoste <flacoste@logreport.org>
the icon who wrote this. we stan. π
π§ VERSION π§
$Id: LrCommand.pm,v 1.9 2006/07/23 13:16:29 vanbaal Exp $
πΈ COPYRIGHT πΈ
Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
π«Ά real talk: that warranty disclaimer is doing a lot of heavy lifting, so don't sleep on it β it literally says WITHOUT ANY WARRANTY. read your licenses bestie. π
and that's the whole page!! this cutie is from Lire 2.1.1, dated 2025-09-28, and it's literally the LrCommand(3pm) manpage. go build something iconic with it πβ¨π
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms