-
Notifications
You must be signed in to change notification settings - Fork 68
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
CLI arguments made order invariant #81
Merged
shaikatz
merged 10 commits into
Soluto:master
from
AleF83:cli-arguments-order-invariant
Jan 17, 2019
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b4736b4
CLI arguments made order invariant
AleF83 e0a1c4b
Tests fixed and ESLint added
AleF83 6b6b061
Tiny refactor
AleF83 f9f34b6
Remove bold inserted by mistake
AleF83 53577b6
bug fixed
AleF83 ee535e5
api removed from kamus-api-url argument
AleF83 ae6438e
One more fix
AleF83 74e6afd
Merge branch 'master' into cli-arguments-order-invariant
AleF83 a2b0a49
CLI package version bumped
AleF83 15b87af
Short alias to options provided
AleF83 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"env": { | ||
"browser": false, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2017 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,14 @@ const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[ | |
prog | ||
.version(pjson.version) | ||
.command('encrypt', 'Encrypt data') | ||
.argument('<data>','Data to encrypt') | ||
.argument('<service-account>', 'Deployment service account') | ||
.argument('<namespace>', 'Deployment namespace') | ||
.action(encrypt) | ||
.action(encrypt) | ||
.option('--secret <data>','Data to encrypt', prog.REQUIRED) | ||
.option('--service-account <service-account>', 'Deployment service account', prog.REQUIRED) | ||
.option('--namespace <namespace>', 'Deployment namespace', prog.REQUIRED) | ||
.option('--kamus-api-url <kamusApiUrl>', 'Kamus URL', prog.REQUIRED) | ||
.option('--auth-tenant <id>', 'Azure tenant id', regexGuid) | ||
.option('--auth-application <id>', 'Azure application id', regexGuid) | ||
.option('--auth-resource <name>', 'Azure resource name', prog.STRING) | ||
.option('--kamus-url <url>', 'Kamus URL', prog.REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer to keep it shorter - |
||
.option('--allow-insecure-url', 'Allow insecure (http) Kamus URL', prog.BOOL) | ||
.option('--cert-fingerprint <certFingerprint>', 'Force server certificate to match the given fingerprint', prog.STRING); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This makes the arguments global options, and not only for the encrypt commands - correct? Isn't it weird?
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.
I don't think it makes the arguments global. I chained another
command
method and didn't see that arguments in the second command help.Only arguments or options that are set before the first
command
method are global.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.
So if what you're saying is true - all these:
Should move up before the first command...