Use cli parser with auto-generated help

This commit is contained in:
Aleksey Kladov 2021-03-01 21:12:44 +03:00
parent 9860a39603
commit 4ce20b80c5
8 changed files with 195 additions and 134 deletions

View file

@ -18,7 +18,7 @@ use std::{
};
use xshell::{cmd, pushenv, read_file, write_file};
use crate::{ensure_rustfmt, project_root, Result};
use crate::{ensure_rustfmt, flags, project_root, Result};
pub(crate) use self::{
gen_assists_docs::{generate_assists_docs, generate_assists_tests},
@ -35,11 +35,7 @@ pub(crate) enum Mode {
Verify,
}
pub(crate) struct CodegenCmd {
pub(crate) features: bool,
}
impl CodegenCmd {
impl flags::Codegen {
pub(crate) fn run(self) -> Result<()> {
if self.features {
generate_lint_completions(Mode::Overwrite)?;