Warn if `>` is passed without quotes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 40.5k
- Forks
- 2.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 85
Description
Related problem
I use both nushell and bash and sometimes I forget which shell I'm in. I'll fall back to typing foo > file instead of foo out> file which generally fails because the program I'm invoking doesn't like > as a command line argument. I just had a case however where that argument was ignored and thought I was updating files that I was in fact doing nothing with. The result was still unexpected but it took me quite a while to figure out. My first thought was that I need to redirect stderr not stdout because despite redirecting I could still see the output (a common occurence with stderr).
Describe the solution you'd like
I think if a user uses > as a command line option and doesn't quote it they're probably making a mistake since that's just so uncommon due to the last unteenth years of it meaning something else in more widely used shells.
Describe alternatives you've considered
If you wanted to you could be really extreme and reserve it perhaps so that it has to be quoted. Or you could be a bit more lax and only warn after the program finishes and only if it returns an exit code of zero
Additional context and details
Basically, its not always apparent (but 99% time time it is, this is just that 1% remaining case) that I'm mis-using > and I'd like a hint in the future about this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by tracing how Nushell parses and passes an unquoted > command argument, then determine a warning policy from the reported cases; done requires an agreed behavior and coverage for the misleading-success scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100