mirror of
https://github.com/bevyengine/bevy
synced 2024-12-23 19:43:07 +00:00
9c17fc2d8d
# 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.
17 lines
619 B
Rust
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
|
|
}
|
|
}
|