Reduce the API of ruff_cli to ruff_cli::help()

This commit is contained in:
Martin Fischer 2023-01-14 07:34:13 +01:00 committed by Charlie Marsh
parent 92124001d5
commit a181ca7a3d
2 changed files with 8 additions and 6 deletions

View file

@ -1,8 +1,7 @@
//! Generate CLI help.
use anyhow::Result;
use clap::{Args, CommandFactory};
use ruff_cli::Cli as MainCli;
use clap::Args;
use crate::utils::replace_readme_section;
@ -21,8 +20,7 @@ fn trim_lines(s: &str) -> String {
}
pub fn main(cli: &Cli) -> Result<()> {
let mut cmd = MainCli::command();
let output = trim_lines(cmd.render_help().to_string().trim());
let output = trim_lines(ruff_cli::help().trim());
if cli.dry_run {
print!("{output}");