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

feat: better handle interactivity in start command #611

Merged
merged 3 commits into from
Jul 23, 2019

Conversation

zamotany
Copy link
Contributor

No description provided.

@zamotany zamotany requested a review from thymikee July 22, 2019 16:16
@zamotany zamotany added this to In progress in Public 1.0 Jul 22, 2019
@thymikee
Copy link
Member

FYI yargs supports negating params with --no-: https://github.com/yargs/yargs/blob/master/docs/tricks.md#negate
So having --interactive that defaults to false has already support for --no-interactive setting interactive arg to false.

@zamotany
Copy link
Contributor Author

@thymikee yeah but it doesn't work the same way, I've manually checked and unless I provide = it doesn't detect correct value:

  • --no-interactive false results in undefiend
  • --no-interactive true results in undefined
    Only --no-interactive=true sets it to true

@thymikee
Copy link
Member

The idea is to just run --no-interactive or --interactive, doesn't that work?

@zamotany
Copy link
Contributor Author

@thymikee Nope, was saying it's undefined when only --no-interactive was passed

@thymikee
Copy link
Member

Weird.

@zamotany
Copy link
Contributor Author

Screenshot 2019-07-23 at 12 53 01

@thymikee

@thymikee
Copy link
Member

Ah, it's probably because you name the flag as no-interactive. It should be called interactive for yargs, and it will figure out that when you prepend no-, it means false

@zamotany
Copy link
Contributor Author

Well then, in the end I still have to change that option to interactive and just mention --no-interactive in the docs.

@thymikee
Copy link
Member

Yep. And also you can mention somewhere at the top that:

Note: for convenience, all boolean flags can be prepended with no- for false value, e.g. --no-interactive will set interactive to false.

@zamotany zamotany merged commit 5c6d3d7 into next Jul 23, 2019
@zamotany zamotany deleted the feat/better-no-interactive-start branch July 23, 2019 11:17
@zamotany zamotany moved this from In progress to Done in Public 1.0 Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Public 1.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants