Skip to main content

clean_cmd_args

Function clean_cmd_args 

Source
fn clean_cmd_args(cmd_args: Vec<OsString>) -> Vec<OsString>
Expand description

Removes the --watch flag from the args for the Watchexec command, so that the child command does not enter watch mode itself and spawn another watcher.

watch is an Option<Vec<PathBuf>>, so clap accepts the flag as --watch <PATH>, --watch=<PATH>, -w <PATH>, and -w<PATH>, combines it with other short flags (-vw, -vw<PATH>), and allows it to repeat, appending the paths of every occurrence.