1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "limavel",
version,
about = "LIMA Virtual Environment for Laravel",
before_help = r#"
╷ ╷╭┬╮╭─╮╷ ╷╭─╴╷
│ ││││├─┤│╭╯├╴ │
╰─╴╵╵ ╵╵ ╵╰╯ ╰─╴╰─╴"#
)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Initialize a new configuration file
Init {
/// Instance name (creates <name>.yaml, defaults to "limavel")
#[arg(default_value = "limavel")]
name: String,
},
/// Start the development VM (creates it if needed)
Start {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
/// Do not update /etc/hosts with site domains
#[arg(long)]
no_hosts: bool,
},
/// Stop the development VM
Stop {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
/// Do not remove /etc/hosts entries
#[arg(long)]
no_hosts: bool,
},
/// Restart the development VM
Restart {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
},
/// Re-provision the development VM
Provision {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
},
/// SSH into the development VM
Ssh {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
},
/// Show SSH connection details for the VM
SshDetails {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
},
/// Show the VM instance status
Status {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
},
/// Edit VM resources (memory, cpus) from config
Edit {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
},
/// Destroy the VM instance
Destroy {
/// Instance name (reads <name>.yaml, auto-detected if omitted)
name: Option<String>,
},
/// Publish embedded bootstrap and ansible directories to the filesystem
Publish {
/// Target directory (defaults to current directory)
#[arg(default_value = ".")]
path: String,
},
}