heddle_cli_args/cli/cli_args/
commands_import.rs1use clap::{Args, Subcommand};
5
6use super::ImportLocalArgs;
7
8#[derive(Args, Clone, Debug)]
9#[command(verbatim_doc_comment)]
10#[command(about = "Bring an existing Git repository into Heddle.")]
11#[command(long_about = "Bring an existing Git repository into Heddle.")]
12#[command(after_help = "\
13Choose a source:
14 local Import a Git checkout on this computer.
15 url Have the server import a public HTTPS Git URL.
16
17Already checked out the repository?
18 heddle import local .
19 heddle push <destination>
20
21Want the server to fetch it, without a local checkout?
22 heddle import url https://github.com/acme/widget.git --to <handle>/widget
23
24Use \"heddle init\" to start a repository or keep working in Git mode.
25Use \"heddle clone\" to download an existing hosted Heddle repository.
26")]
27pub struct ImportArgs {
28 #[command(subcommand)]
29 pub command: ImportCommands,
30}
31
32#[derive(Subcommand, Clone, Debug)]
33pub enum ImportCommands {
34 Local(ImportLocalArgs),
36
37 #[cfg(feature = "client")]
39 Url(ImportUrlArgs),
40
41 #[cfg(feature = "client")]
46 Status(ImportOperationArgs),
47
48 #[cfg(feature = "client")]
50 Retry(ImportOperationArgs),
51}
52
53#[cfg(feature = "client")]
54#[derive(Args, Clone, Debug)]
55pub struct ImportUrlArgs {
56 #[arg(value_name = "URL")]
58 pub url: String,
59
60 #[arg(long, value_name = "SPOOL|URL")]
62 pub to: String,
63
64 #[arg(long, value_name = "HOST")]
66 pub server: Option<String>,
67}
68
69#[cfg(feature = "client")]
70#[derive(Args, Clone, Debug)]
71pub struct ImportOperationArgs {
72 #[arg(value_name = "OPERATION")]
74 pub operation: String,
75
76 #[arg(long, value_name = "SPOOL|URL")]
78 pub to: String,
79
80 #[arg(long, value_name = "HOST")]
82 pub server: Option<String>,
83}