-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add support for "config get/set" command #603
Closed
Closed
Conversation
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 allows a user to print a single configuration value from their AWS config file. It only looks in the config file, does not look in env vars, command line args, etc. It supports scoped values (to a specific profile) as well as explicitly specifying a section name via (`section-name.config-value`). In order to support this, I added support for positional arguments in the Command class arg table. I also added support for reading descriptions/examples from a specific file, rather than relying on the default value. This is needed for subcommands, unless we pass through parent command information to subcommands.
This allows a user to set a single configuration variable without having to edit the contents of the config file. This makes it possible to completely shield the user from knowing where the config file is. This supports the same syntax as "get" with respect to the qualified and unqualified names.
Need to ensure args match the same order as the ARG_TABLE list.
for i in range(len(contents)): | ||
line = contents[i] | ||
if line.strip().startswith(('#', ';')): |
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.
LGTM otherwise. 🚢 it! |
@toastdriven Feedback incorporated, thanks. |
Merged in dd0769d |
thoward-godaddy
pushed a commit
to thoward-godaddy/aws-cli
that referenced
this pull request
Feb 12, 2022
thoward-godaddy
pushed a commit
to thoward-godaddy/aws-cli
that referenced
this pull request
Feb 12, 2022
* fix: Functional tests must run on localhost to work in Windows (aws#552) * fix: spacing typo in Log statement in start-lambda (aws#559) * docs: Fix syntax highlighting in README.md (aws#561) * docs: Change jest to mocha in Nodejs init README (aws#564) * docs: Fix @mhart link in README (aws#562) * docs(README): removed cloudtrail, added SNS to generate-event (aws#569) * docs: Update repo name references (aws#577) * feat(debugging): Fixing issues around debugging Golang functions. (aws#565) * fix(init): Improve current init samples around docs and fixes (aws#558) * docs(README): Update launch config to SAM CLI from SAM Local (aws#587) * docs(README): Update sample code for calling Local Lambda Invoke (aws#584) * refactor(init): renamed handler for camel case, moved callback call up (aws#586) * chore: aws-lambda-java-core 1.1.0 -> 1.2.0 for java sam init (aws#578) * feat(validate): Add profile and region options (aws#582) Currently, `sam validate` requires AWS Creds (due to the SAM Translator). This commits adds the ability to pass in the credientials through a profile that is configured through `aws configure`. * docs(README): Update README prerequisites to include awscli (aws#596) * fix(start-lambda): Remove Content-Type Header check (aws#594) * docs: Disambiguation "Amazon Kinesis" (aws#599) * docs: Adding instructions for how to add pyenv to your PATH for Windows (aws#600) * docs: Update README with small grammar fix (aws#601) * fix: Update link in NodeJS package.json (aws#603) * docs: Creating instructions for Windows users to install sam (aws#605) * docs: Adding a note directing Windows users to use pipenv (aws#606) * fix: Fix stringifying λ environment variables when using Python2 (aws#579) * feat(generate-event): Added support for 50+ events (aws#612) * feat(invoke): Add region parameter to all invoke related commands (aws#608) * docs: Breaking up README into separate files to make it easier to read (aws#607) * chore: Update JVM size params to match docker-lambda (aws#615) * feat(invoke): Invoke Function Without Parameters through --no-event (aws#604) * docs: Update advanced_usage.rst with clarification on --env-vars usage (aws#610) * docs: Remove an extra word in the sam packaging command (aws#618) * UX: Improves event names to reflect Lambda Event Sources (aws#619) * docs: Fix git clone typo in installation docs (aws#630) * docs(README): Callout go1.x runtime support (aws#631) * docs(installation): Update sam --version command (aws#634) * chore(0.6.0): SAM CLI Version bump (aws#635)
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.
Add support for the "configure get" subcommand
This allows a user to print a single configuration value
from their AWS config file. It only looks in the config file, does not
look in env vars, command line args, etc. It supports scoped values (to
a specific profile) as well as explicitly specifying a section name via
(
section-name.config-value
).In order to support this, I added support for positional arguments in
the Command class arg table. I also added support for reading
descriptions/examples from a specific file, rather than relying on the
default value. This is needed for subcommands, unless we pass through
parent command information to subcommands.
Add support "configure set" command
This allows a user to set a single configuration variable
without having to edit the contents of the config file.
This makes it possible to completely shield the user from knowing
where the config file is.
This supports the same syntax as "get" with respect to the qualified
and unqualified names.