Skip to content
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

Print text before the help appears [Opposite of .epilogue()] #401

Closed
ghost opened this issue Feb 22, 2016 · 2 comments
Closed

Print text before the help appears [Opposite of .epilogue()] #401

ghost opened this issue Feb 22, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 22, 2016

Hi! 😃

While reading the yarg docs I stumbled upon the .epilogue() function.

It's really useful, but how would I print text (like some fancy ascii-arts) before the help appears?

I thought of something like .prologue()/.prolog() or .intro() but found nothing.

Thanks in advance!

@ghost ghost changed the title How to print text before the help appears? [Opposite of .epilogue()] Print text before the help appears [Opposite of .epilogue()] Feb 22, 2016
@nexdrew
Copy link
Member

nexdrew commented Feb 22, 2016

@sn0w Try the .usage() method if you want the text to be part of the help content (but displayed first).

If you don't want the text to be part of the help content, then you can just console.log('any text here') before you access yargs.argv (which parses the command line args and prints help/error content if necessary).

Let us know if this doesn't suit your needs. Thanks!

@nexdrew
Copy link
Member

nexdrew commented Mar 21, 2016

@sn0w Gonna go ahead and close this. If there's something else you'd like to see yargs do, feel free to open another issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant