workspacer_cli/format.rs
1// ---------------- [ File: workspacer-cli/src/format.rs ]
2crate::ix!();
3
4/// Format imports in all crates or a single crate
5#[derive(Debug, StructOpt)]
6pub enum FormatSubcommand {
7 /// Format the imports in one specific crate
8 Imports(FormatImportsCommand),
9
10 /// Format the imports in all crates of this workspace
11 AllImports(FormatAllImportsCommand),
12}
13
14impl FormatSubcommand {
15 pub async fn run(&self) -> Result<(), WorkspaceError> {
16 match self {
17 FormatSubcommand::Imports(cmd) => cmd.run().await,
18 FormatSubcommand::AllImports(cmd) => cmd.run().await,
19 }
20 }
21}