Prevent roc format from reading $PWD when --stdin or --stdout options given

This commit is contained in:
Michael Pfeifer 2024-01-24 23:48:54 +01:00
parent 8e0e48e0bb
commit 390808eb12
No known key found for this signature in database
GPG key ID: 97E1DEF12B1B8486
2 changed files with 3 additions and 1 deletions

View file

@ -266,7 +266,7 @@ pub fn build_app() -> Command {
.arg(args_for_app.clone().last(true))
)
.subcommand(Command::new(CMD_FORMAT)
.about("Format a .roc file using standard Roc formatting")
.about("Format a .roc file or the .roc files contained in a directory using standard\nRoc formatting")
.arg(
Arg::new(DIRECTORY_OR_FILES)
.index(1)
@ -294,6 +294,7 @@ pub fn build_app() -> Command {
.action(ArgAction::SetTrue)
.required(false),
)
.after_help("If DIRECTORY_OR_FILES is omitted, the .roc files in the current working\ndirectory are formatted.")
)
.subcommand(Command::new(CMD_VERSION)
.about(concatcp!("Print the Roc compilers version, which is currently ", VERSION)))

View file

@ -287,6 +287,7 @@ fn main() -> io::Result<()> {
values.push(os_string.to_owned());
}
}
None if from_stdin || to_stdout => {}
None => {
let mut os_string_values: Vec<OsString> = Vec::new();