support plus sign for "into filesize"#12974
Merged
WindSoilder merged 6 commits intonushell:mainfrom Jun 4, 2024
Merged
Conversation
IanManske
reviewed
May 26, 2024
Member
IanManske
left a comment
There was a problem hiding this comment.
Thanks for the PR! It looks like strings that start with a plus sign already worked if they did not have a filesize unit (e.g., '+1' | into filesize). So, with this PR, '++1' | into filesize now works 👀.
IanManske
reviewed
May 28, 2024
Member
IanManske
left a comment
There was a problem hiding this comment.
Looks good! Just two minor things:
hqsz
commented
May 29, 2024
hqsz
commented
May 29, 2024
Contributor
Author
|
Thanks for reviewing! I also left some minor questions which is occurred while i writing new codes. |
IanManske
approved these changes
May 30, 2024
Member
IanManske
left a comment
There was a problem hiding this comment.
We are currently in the process of doing a patch release. This PR will be merged after that. Thanks for all of your work here!
WindSoilder
pushed a commit
that referenced
this pull request
Jun 10, 2024
# Description Fix wrong casting which is related to #12974 (comment) # User-Facing Changes AS-IS (before fixing) ``` $ "-10000PiB" | into filesize 6.2 EiB <--- Wrong casted value $ "10000PiB" | into filesize -6.2 EiB <--- Wrong casted value ``` TO-BE (after fixing) ``` $ "-10000PiB" | into filesize Error: nu::shell::cant_convert × Can't convert to filesize. ╭─[entry #6:1:1] 1 │ "-10000PiB" | into filesize · ─────┬───── · ╰── can't convert string to filesize ╰──── $ "10000PiB" | into filesize Error: nu:🐚:cant_convert × Can't convert to filesize. ╭─[entry #7:1:1] 1 │ "10000PiB" | into filesize · ─────┬──── · ╰── can't convert string to filesize ╰──── ```
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
Fixes #12968. After apply this patch, we can use explict plus sign character included string with
into filesizecmd.User-Facing Changes
AS-IS (before fixing)
TO-BE (after fixing)
Tests + Formatting
Added a test
After Submitting