-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat(cli): allow hiding scripts from the help list #56
Conversation
Allows adding a 'hiddenFromHelp' property to a script object so that it does not show up in the help list.
Current coverage is 100% (diff: 100%)@@ master #56 diff @@
===================================
Files 11 11
Lines 242 246 +4
Methods 0 0
Messages 0 0
Branches 0 0
===================================
+ Hits 242 246 +4
Misses 0 0
Partials 0 0
|
@@ -32,7 +44,7 @@ test('resolves default to the script if it is a string', t => { | |||
t.is(result, 'string') | |||
}) | |||
|
|||
test('does not resolve a script object without a script or defualt', t => { | |||
test('does not resolve a script object without a script or default', t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Scripts should not be ignored from the help list simply because the 'hiddenFromHelp' key is present. They should only be hidden if it's present and truthy. This fixes that and the test that was supposed to ensure that. #41
LGTM |
@sxn, thanks so much for this feature! I've added you as a collaborator on the project. Accept that invitation and feel free to squash and merge this PR yourself :) Feel free to watch the repo and continue making contributions as you feel the need/desire :) Thanks again! |
Nice! Thanks, will do. :) |
Oh one sec! Could you add some docs in the README for this feature? |
Sure thing! |
LGTM |
What: Allow scripts to be hidden from the help list.
Why: In order to allow having semi-private scripts - semi because they will still be runnable as long as you know they're there.
How: by changing the
src/resolve-script-object-to-string.js::resolveScriptObjectToScript
function so that if thehiddenFromHelp
property is defined and truthy, undefined is returned.