elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.72k stars 303 forks source link

"Wildcard has no match" exception is unergonomic #1852

Open tesujimath opened 2 weeks ago

tesujimath commented 2 weeks ago

What new feature should Elvish have?

I see that the exception throwing by default when wildcards have no match was added some time ago in response to a real issue.

However, the behaviour we have now is rather awkward. For example, when wanting to delete any file matching some set of wildcards:

> ls
a  ab  abc
> rm -f ab* bc*
Exception: wildcard has no match
  [tty 38]:1:11-13: rm -f ab* bc*
> ls
a  ab  abc

> rm -f ab*[nomatch-ok] bc*[nomatch-ok]
> ls
a

Bash is much more convenient:

> bash
$ ls
a  ab  abc
$ rm -f ab* bc*
$ ls
a

Could there be room for a rethink here?

Output of "elvish -version"

0.21.0

Code of Conduct