Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Getopt::TooMany: looking for a perfect CLI processor

by rjt (Curate)
on Sep 07, 2019 at 08:27 UTC ( #11105783=note: print w/replies, xml ) Need Help??

in reply to Getopt::TooMany: looking for a perfect CLI processor

For help generation and better error handling, Pod::Usage has been in my toolbox for a long time. It will pull the help right from your perldoc POD. (Which you were hopefully going to write anyway, so it's no extra work.) It is configurable as to which sections it will pull and display when help is needed.

Your point #2 has me confused. Why is that important, as long as the interface is well designed and documented?

Point #3, there are indeed a lot of features from Pod::Usage and the plethora of Getopt:: modules you've seen. None that I know you need though. (And none that I use on a regular basis.)

Replies are listed 'Best First'.
Re^2: Getopt::TooMany: looking for a perfect CLI processor
by Dallaylaen (Chaplain) on Sep 10, 2019 at 13:10 UTC

    I don't know, somehow I prefer to have option descriptions close to the declarations. A POD is (hopefully) a comprehensive manual with detailed explanations, whereas --help is just a quick reminder for those who can't keep all the options in their head. Maybe I'm wrong and will change my mind later.

    #2 is merely avoiding namespace pollution (via lots of exported functions - easy to forget or hit a collision), @ISA clutter (when one has to extend a Getopt:: class - I've seen that a couple times on CPAN), and awkward syntax (local $Foo::Bar::VariableName = $Foo::Bar::VariableName + 1 is a cool feature, but let's use it when it's needed).

    Oh and thanks for mentioning Pod::Usage, I didn't know of that one.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11105783]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2023-03-29 00:54 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (70 votes). Check out past polls.