Skip to content

Commit

Permalink
Use command_display
Browse files Browse the repository at this point in the history
Summary: Simpler.

Reviewed By: aniketmathur

Differential Revision: D55204652

fbshipit-source-id: 174904865e33a4874e2c7902366f2ae8db641472
  • Loading branch information
ndmitchell authored and facebook-github-bot committed Mar 21, 2024
1 parent 121e72c commit 786a082
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions targets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
// We use a separate lib since doctests in a binary are ignored,
// and we'd like to use doctests.

#![feature(iter_intersperse)]
#![forbid(unsafe_code)]

use std::ffi::OsStr;
use std::ffi::OsString;
use std::path::PathBuf;
use std::process;
use std::process::Command;

use clap::Parser;
use td_util::command::display_command;

/// Run `buck2 targets` with all the arguments required for BTD/Citadel.
#[derive(Parser)]
Expand Down Expand Up @@ -106,15 +104,7 @@ pub fn run(
command.args(arguments);

if dry_run {
println!(
"{} {}",
buck,
command
.get_args()
.intersperse(OsStr::new(" "))
.collect::<OsString>()
.to_string_lossy()
);
println!("{}", display_command(&command));
return Ok(());
}

Expand Down

0 comments on commit 786a082

Please sign in to comment.