matklad / xshell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`set_*` on `Cmd` should return `Self` and not take it by reference

repnop opened this issue · comments

The rest of the builder-style options do this, but not the set_*, which is a really awkward divide when you want to have those be configurable from elsewhere.

That's intentional: set_ work even if you have only &mut Cmd. The other methods take self to make the following work:

let mut cmd = xshell::cmd!().quiet();
cmd.run()

Perhaps we should add with_ family though?

Let's leave as is, unless someone shows a really compelling use-case where with_ would make the code significatnly nicer.