use crate::{ cmd_output, cmds::{ arg::empty::JVEmptyArgument, collect::empty::JVEmptyCollect, converter::workspace_operation_error::JVWorkspaceOperationErrorConverter, r#in::empty::JVEmptyInput, out::none::JVNoneOutput, }, systems::{ cmd::{ cmd_system::{AnyOutput, JVCommandContext}, errors::{CmdExecuteError, CmdPrepareError}, }, helpdoc::helpdoc_viewer, }, }; use cmd_system_macros::exec; use just_enough_vcs::system::workspace::func::create_workspace_here; pub struct JVWorkspaceInitCommand; type Cmd = JVWorkspaceInitCommand; type Arg = JVEmptyArgument; type In = JVEmptyInput; type Collect = JVEmptyCollect; async fn help_str() -> String { helpdoc_viewer::display("commands/workspace/init").await; String::new() } async fn prepare(_args: &Arg, _ctx: &JVCommandContext) -> Result { Ok(JVEmptyInput) } async fn collect(_args: &Arg, _ctx: &JVCommandContext) -> Result { Ok(JVEmptyCollect) } #[exec] async fn exec(_input: In, _collect: Collect) -> Result { create_workspace_here() .await .map_err(JVWorkspaceOperationErrorConverter::to_exec_error)?; cmd_output!(JVNoneOutput => JVNoneOutput) } crate::command_template!();