1crate::ix!();
3
4#[derive(Debug, StructOpt)]
5pub enum GetSubcommand {
6 LockVersions {
8 #[structopt(long = "path")]
9 workspace_path: Option<PathBuf>,
10
11 #[structopt(long = "skip-git-check")]
12 skip_git_check: bool,
13 },
14
15 Toml {
17 #[structopt(long = "section")]
18 section: String,
19
20 #[structopt(long = "crate")]
21 crate_name: Option<String>,
22 },
23}
24
25impl GetSubcommand {
26 pub async fn run(&self) -> Result<(), WorkspaceError> {
28 match self {
29 GetSubcommand::LockVersions {
31 workspace_path,
32 skip_git_check,
33 } => {
34 get_lock_versions_flow(
35 workspace_path.clone(),
36 *skip_git_check
37 ).await
38 },
39
40 GetSubcommand::Toml { section, crate_name } => {
42 get_toml_section_flow(
43 section.clone(),
44 crate_name.clone(),
45 ).await
46 }
47 }
48 }
49}