updates let-env signature to remove required params#9917
Merged
fdncred merged 2 commits intonushell:mainfrom Aug 4, 2023
Merged
updates let-env signature to remove required params#9917fdncred merged 2 commits intonushell:mainfrom
let-env signature to remove required params#9917fdncred merged 2 commits intonushell:mainfrom
Conversation
amtoine
reviewed
Aug 4, 2023
Member
amtoine
left a comment
There was a problem hiding this comment.
but now we get
> let-env FOO = "foo"
Error: nu::parser::extra_positional
× Extra positional argument.
╭─[entry #1:1:1]
1 │ let-env FOO = "foo"
· ─┬─
· ╰── extra positional argument
╰────
help: Usage: let-envinstead of
> let-env FOO = "foo"
Error: nu::shell::deprecated_command
× Deprecated command let-env
╭─[entry #18:1:1]
1 │ let-env FOO = "foo"
· ───┬───
· ╰── 'let-env' is deprecated. Please use '$env.<environment variable> = ...' instead.
╰────🤔
Contributor
Author
|
Apparently, we have to "pick our poison". At least it's not telling you to use an old syntax and when you're typing |
Contributor
|
As mentioned in discord, I believe this will work if you make the params optional rather than required (or removed). |
Contributor
Author
|
updated to optional, seems to be working as expected now. |
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.
Description
This PR changes the signature of the deprecated command
let-envso that it does not mislead people when invoking it without parameters.Before
After
User-Facing Changes
Tests + Formatting
After Submitting