LrCommand(3pm)

πŸ“¦ version 2.1.1, in arch rolling

πŸ’– 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 $logfile is compressed, it gets decompressed to a file in $TMPDIR. and if the $logfile is read from a pipe or from STDIN, 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 🌈

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 (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