New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a more informative default usage text #4

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
@jjatria

jjatria commented Aug 3, 2017

When calling usage on commands without POD, the empty string was printed, and when calling the top-level command the string "[undocumented]" was printed next to each command.

But all the information to provide a more informative default usage message is already available to App::CLI in the form of the options and global_options methods.

This patch makes usage print the results of default_usage when the regular process would result in an empty string.

I had originally intended for this to change the behaviour of usage so that it returned the usage string instead of the (largely useless) return value of printing it. But since the printing behaviour is documented, this patch keeps the printing, and makes the function also return the more useful usage text.

@jjatria

This comment has been minimized.

Show comment
Hide comment
@jjatria

jjatria Aug 3, 2017

I am closing this PR since I am now thinking that this should be done differently.

I'll try to write again soon to explain what I'm thinking in more detail. Sorry for the distraction!

jjatria commented Aug 3, 2017

I am closing this PR since I am now thinking that this should be done differently.

I'll try to write again soon to explain what I'm thinking in more detail. Sorry for the distraction!

@jjatria jjatria closed this Aug 3, 2017

@paultcochrane

This comment has been minimized.

Show comment
Hide comment
@paultcochrane

paultcochrane Aug 7, 2017

Owner

No worries about the distraction :-) I'm really impressed with your patches; it's great work keep it up! Sorry I haven't replied until now, I'll try to get the patches merged over the next few days.

Owner

paultcochrane commented Aug 7, 2017

No worries about the distraction :-) I'm really impressed with your patches; it's great work keep it up! Sorry I haven't replied until now, I'll try to get the patches merged over the next few days.

@jjatria

This comment has been minimized.

Show comment
Hide comment
@jjatria

jjatria Aug 7, 2017

Glad you've liked them!

I've been putting off writing about my other ideas because my Amsterdam slides are not going to write themselves. But after that for sure!

jjatria commented Aug 7, 2017

Glad you've liked them!

I've been putting off writing about my other ideas because my Amsterdam slides are not going to write themselves. But after that for sure!

@paultcochrane

This comment has been minimized.

Show comment
Hide comment
@paultcochrane

paultcochrane Aug 7, 2017

Owner

Maybe we can discuss this more in Amsterdam?

Owner

paultcochrane commented Aug 7, 2017

Maybe we can discuss this more in Amsterdam?

@jjatria

This comment has been minimized.

Show comment
Hide comment
@jjatria

jjatria Aug 8, 2017

Sounds good!

jjatria commented Aug 8, 2017

Sounds good!

@paultcochrane

This comment has been minimized.

Show comment
Hide comment
@paultcochrane

paultcochrane Aug 10, 2017

Owner

Hi! Could you paste in here the command line for this that you showed me yesterday? I'll convert that into a test and add it to the test suite. Thanks in advance!

Owner

paultcochrane commented Aug 10, 2017

Hi! Could you paste in here the command line for this that you showed me yesterday? I'll convert that into a test and add it to the test suite. Thanks in advance!

@jjatria

This comment has been minimized.

Show comment
Hide comment
@jjatria

jjatria Aug 10, 2017

Definitely. This is the command I was using:

perl -Ilib -It/lib -MMyApp -e 'local @ARGV = qw( arguments ); MyApp->dispatch'

jjatria commented Aug 10, 2017

Definitely. This is the command I was using:

perl -Ilib -It/lib -MMyApp -e 'local @ARGV = qw( arguments ); MyApp->dispatch'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment