We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc63493 commit e914bc0Copy full SHA for e914bc0
src/cmd.rs
@@ -184,6 +184,33 @@ pub trait CommandBuilder {
184
self
185
}
186
187
+ /// Add the argument if `apply` is `true`.
188
+ fn maybe_with_arg<S>(self, apply: bool, arg: S) -> Self
189
+ where
190
+ Self: Sized,
191
+ S: AsRef<OsStr>,
192
+ {
193
+ if apply {
194
+ self.with_arg(arg)
195
+ } else {
196
+ self
197
+ }
198
199
+
200
+ /// Add the arguments if `apply` is `true`.
201
+ fn maybe_with_args<I, S>(self, apply: bool, args: I) -> Self
202
203
204
+ I: IntoIterator<Item = S>,
205
206
207
208
+ self.with_args(args)
209
210
211
212
213
214
/// Akin to [`Command::env`].
215
fn with_env<K, V>(self, key: K, val: V) -> Self
216
where
0 commit comments