fix: always ensure the base command is set to "sam"#1017
Merged
sriram-mv merged 3 commits intoaws:developfrom Feb 21, 2019
Merged
fix: always ensure the base command is set to "sam"#1017sriram-mv merged 3 commits intoaws:developfrom
sriram-mv merged 3 commits intoaws:developfrom
Conversation
- irrespective of the module name that invokes the CLI, the command that is seen on the help/description text, should always say "sam"
sriram-mv
commented
Feb 20, 2019
samcli/cli/command.py
Outdated
|
|
||
| # NOTE(TheSriram): info_name is always set to "sam". This way when the CLI is invoked as a module, | ||
| # the help text that is generated still says "sam" instead of "__main__". | ||
| def make_context(self, info_name, args, parent=None, **extra): |
Contributor
Author
There was a problem hiding this comment.
Original make_context function: https://github.com/pallets/click/blob/38a2712d596a5df9288c1817748b71197d8c7c57/click/core.py#L621
Contributor
Author
There was a problem hiding this comment.
pallets/click#82 is a better way to do it.
Contributor
There was a problem hiding this comment.
That is super clean. Nice find!
170e254 to
ede5419
Compare
ede5419 to
f9e0569
Compare
sanathkr
approved these changes
Feb 21, 2019
Contributor
Author
|
restarting build, due to transient failure. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
is seen on the help/description text, should always say "sam"
Example
we now see
sam [OPTIONS] COMMAND [ARGS]...instead of__main__.py [OPTIONS] COMMAND [ARGS]...By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.