Skip Menu |

This queue is for tickets about the App-CmdDispatch CPAN distribution.

Report information
The Basics
Id: 126928
Status: open
Priority: 0/
Queue: App-CmdDispatch

People
Owner: cpan.wade [...] anomaly.org
Requestors: dmuey [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: a few help related improvements
Hey Wade! Hope everything is well for you :) I have a few ideas I’d like to run by you to see if you're interested or not: 1. A way to specify the order of sub commands in hint/help. this would allow grouping commands logically and putting utility ones like hint/help at the beginning or maybe shell at the end 2. a pre help hook We have a case where we need to modify help based on various things and it’d be nice to avoid doing that work every time to determine and set up help text and then throw it it away on non-help executions. 3. default verbiage We do this in every A::CD based script: ``` my $hint_blurb = "This tool supports the following commands (i.e. $0 {command} …):"; my $opts = { 'help:pre_hint' => $hint_blurb, 'help:pre_help' => "Yadda yadda yadda\n\n$hint_blurb", ``` It'd be awesome if: - `help:pre_hint` defaulted to that. - `help:append_pre_hint_to_prehelp => 0|1` was an option (default to true), which would append "\n\n$opts->{'help:pre_hint'}"
On Thu Aug 23 09:27:39 2018, DMUEY wrote: Show quoted text
> Hey Wade! > > Hope everything is well for you :)
Hey Dan, Hope you are doing well. Show quoted text
> I have a few ideas I’d like to run by you to see if you're interested > or not: > > 1. A way to specify the order of sub commands in hint/help. > > this would allow grouping commands logically and putting utility ones > like hint/help at the beginning or maybe shell at the end
Would the configuration option "command_sort" do what you need? Show quoted text
> 2. a pre help hook > > We have a case where we need to modify help based on various things > and it’d be nice to avoid doing that work every time to determine and > set up help text and then throw it it away on non-help executions.
I had originally intended to allow the user to supply an App::CmdDispatch::Help compatible module for doing things like this. It looks like I didn't put that in. I would be interested in seeing what you have in mind. Show quoted text
> 3. default verbiage > > We do this in every A::CD based script: > > ``` > my $hint_blurb = "This tool supports the following commands (i.e. $0 > {command} …):"; > my $opts = { > 'help:pre_hint' => $hint_blurb, > 'help:pre_help' => "Yadda yadda yadda\n\n$hint_blurb", > ``` > > It'd be awesome if: > - `help:pre_hint` defaulted to that. > - `help:append_pre_hint_to_prehelp => 0|1` was an option (default > to true), which would append "\n\n$opts->{'help:pre_hint'}"
I can see that, but I wonder if it should be a boolean or more. (Append, prepend, something else, ...) I'd have to think on it. If you've got some ideas (and some time), submit a pull request: https://github.com/gwadej/app-cmddispatch If not, I can add it to my project list. Not sure when I would fix. G. Wade
Show quoted text
> If you've got some ideas (and some time), submit a pull request: > https://github.com/gwadej/app-cmddispatch
Thanks, I'll ponder what you said :) Will do, thanks :)