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

Support multiple epilogs being added #1384

Merged
merged 2 commits into from Jul 29, 2019
Merged

Conversation

cameronhunter
Copy link
Contributor

Context

We wrap our commands in a function that adds docs, maintainer, and slack properties to the command module object. We use these properties as part of an automatically generated epilog that we add to each command.

Problem

Currently subsequent calls to epilog will overwrite any previous epilog.

Fix

Store epilogs in an array which is added to on each epilog call. Join them with new lines when building usage.

Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable to me, mind adding one test? thanks for the contribution.

@@ -1921,6 +1922,7 @@ describe('usage tests', () => {
' --version Show version number [boolean]',
' -y [required]',
'for more info view the manual at http://example.com',
'you can also find us on slack at http://devtoolscommunity.herokuapp.com',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps add one additional test with multiple epilogs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. Added.

@bcoe bcoe merged commit 07a5554 into yargs:master Jul 29, 2019
@cameronhunter cameronhunter deleted the multiple-epilogs branch July 29, 2019 23:25
@bcoe
Copy link
Member

bcoe commented Jul 30, 2019

@cameronhunter likewise, available in yargs@next.

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

Successfully merging this pull request may close these issues.

None yet

2 participants