Skip to content
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

Wildcards do fail if empty #115

Closed
piroux opened this issue Jun 2, 2014 · 1 comment
Closed

Wildcards do fail if empty #115

piroux opened this issue Jun 2, 2014 · 1 comment

Comments

@piroux
Copy link

piroux commented Jun 2, 2014

I am no expert but it seems that gnu coreutils commands do fail when are passed a wildcard which matched nothing.

In the arguments docs, you wrote :

This is supported by setting required=True. However, this should not be used if you can avoid it as we believe scripts should gracefully degrade into becoming noops if a variadic argument is empty. The reason for this is that very often, scripts are invoked with wildcard inputs from the commandline and they should not error out if the wildcard is empty.

But in bash, we have :

[piroux@localhost taratata]$ ls -l
total 0
[piroux@localhost taratata]$ find *
find: ‘*’: No such file or directory
[piroux@localhost taratata]$ ls *
ls: cannot access *: No such file or directory
[piroux@localhost taratata]$ tree *
* [error opening dir]
0 directories, 0 files
[piroux@localhost taratata]$ grep hello *
grep: *: No such file or directory
[piroux@localhost taratata]$ cat *
cat: *: No such file or directory
@mitsuhiko
Copy link
Contributor

As I said, I do believe scripts should become noops :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants