-
Notifications
You must be signed in to change notification settings - Fork 10
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
--stdin
doesn't read stdin
#56
Comments
yeah, should probably allow open foo.nu | nufmt --stdin instead of nufmt --stdin (open foo.nu) , right? |
Right. I think taking a literal nushell script as a command line argument doesn't make any sense. Positional arguments and flags are not intended for such long input. |
Hi! you are correct, Well, if it doesn't require a flag to format, should Maybe we can follow this logic
What do you think? |
Passing a value to a flag named "stdin" doesn't make any sense—in this case, it's not standard input, it's just a positional argument. But moreover, I don't think positional arguments of any kind make any sense. There's a limit of 4k for an exec; passing anything but the most trivial of scripts is going to fail. |
I'm not sure if I follow you. What could solve this issue, or what is the expected behavior you would like to see? |
@AucaCoyan open foo.nu | nufmt --stdin |
Thanks! I will head towards it |
Since this is taking a while, here is a very temporary workaround: #!/usr/bin/env -S nu --stdin
nufmt --stdin $in | tail -n +2 I'd like to help myself to speed up, but I'm not sure I will have enough time soon. I just thought that since this is enough for me, to use |
@alecandido are you using |
I'd be glad to give it, I'm just short of time. But I'll definitely take it into account.
I'm just addicted to formatters. The result of |
We would love to have more contributors to this repository. We'd all love to have a good nushell script formatter. |
## Description of changes `--stdin` flag read a command line argument, not stdin. Now it reads from stdin. Not sure if my code would compile on windows, but I don't have a windows computer to test it. I'm aware that #57 tries to solve this as well, but it seems stagnant and won't pass CI. ## Relevant Issues #56
#61 solves the bug, it correctly reads from stdin with the flag
Is it okay to close this issue? |
I'm not sure if I'm just missing something here, but it seems that the
--stdin
flag requires an argument, which is supposed to be a literal nushell script. That's not what standard input means, and limits the size of the script to the system's maximum command size length.I would expect the
--stdin
flag to make the formatter... read from stdin.The text was updated successfully, but these errors were encountered: