bevy/tools/ci/src/commands/doc.rs
BD103 9c17fc2d8d
Restructure ci modules (#13101)
# Objective

- Currently all `ci` commands are in the `subcommands` module. This is
problematic when you want to implement actually subcommands (such as
`cargo r -p ci -- doc check`).
- All command modules include the `_command` suffix, which is redundant.

## Solution

- Move `commands` modules into root crate folder.
- Merge contents of `commands/mod.rs` into `main.rs`.
- Move `commands::subcommands` module into `commands` module.
- Remove the `_command` suffix from all `commands::subcommands` modules.
2024-04-25 18:52:11 +00:00

17 lines
619 B
Rust

use crate::commands::{DocCheckCommand, DocTestCommand};
use crate::{Flag, Prepare, PreparedCommand};
use argh::FromArgs;
/// Alias for running the `doc-test` and `doc-check` subcommands.
#[derive(FromArgs, Default)]
#[argh(subcommand, name = "doc")]
pub(crate) struct DocCommand {}
impl Prepare for DocCommand {
fn prepare<'a>(&self, sh: &'a xshell::Shell, flags: Flag) -> Vec<PreparedCommand<'a>> {
let mut commands = vec![];
commands.append(&mut DocTestCommand::default().prepare(sh, flags));
commands.append(&mut DocCheckCommand::default().prepare(sh, flags));
commands
}
}