1use std::{ffi::OsString, path::PathBuf};
2
3use crate::secrets_cli::SecretsCommand;
4use clap::{Arg, ArgAction, Args, CommandFactory, Parser, Subcommand};
5
6#[derive(Parser, Debug)]
7#[command(name = "greentic-dev")]
8#[command(version)]
9#[command(about = "cli.root.about")]
10pub struct Cli {
11 #[command(subcommand)]
12 pub command: Command,
13}
14
15pub fn localized_help_command(locale: &str) -> clap::Command {
16 let mut command = Cli::command()
17 .about(crate::i18n::t(locale, "cli.root.about"))
18 .disable_help_subcommand(true)
19 .disable_help_flag(true)
20 .disable_version_flag(true)
21 .arg(
22 Arg::new("help")
23 .short('h')
24 .long("help")
25 .action(ArgAction::Help)
26 .help(crate::i18n::t(locale, "cli.help.flag")),
27 )
28 .arg(
29 Arg::new("version")
30 .short('V')
31 .long("version")
32 .action(ArgAction::Version)
33 .help(crate::i18n::t(locale, "cli.version.flag")),
34 )
35 .arg(
36 Arg::new("locale")
37 .long("locale")
38 .global(true)
39 .value_name("LOCALE")
40 .help(crate::i18n::t(locale, "cli.option.locale")),
41 );
42
43 for (name, key) in [
44 ("flow", "cli.command.flow.about"),
45 ("pack", "cli.command.pack.about"),
46 ("component", "cli.command.component.about"),
47 ("bundle", "cli.command.bundle.about"),
48 ("runner", "cli.command.runner.about"),
49 ("config", "cli.command.config.about"),
50 ("coverage", "cli.command.coverage.about"),
51 ("mcp", "cli.command.mcp.about"),
52 ("gui", "cli.command.gui.about"),
53 ("secrets", "cli.command.secrets.about"),
54 ("tools", "cli.command.tools.about"),
55 ("install", "cli.command.install.about"),
56 ("release", "cli.command.release.about"),
57 ("cbor", "cli.command.cbor.about"),
58 ("wizard", "cli.command.wizard.about"),
59 ] {
60 command = command.mut_subcommand(name, |sub| sub.about(crate::i18n::t(locale, key)));
61 }
62
63 command = command.mut_subcommand("secrets", |sub| {
64 sub.about(crate::i18n::t(locale, "cli.command.secrets.about"))
65 .mut_subcommand("init", |sub| {
66 sub.about(crate::i18n::t(locale, "cli.command.secrets.init.about"))
67 .mut_arg("pack", |arg| {
68 arg.help(crate::i18n::t(locale, "cli.command.secrets.init.pack"))
69 })
70 .mut_arg("passthrough", |arg| {
71 arg.help(crate::i18n::t(
72 locale,
73 "cli.command.secrets.init.passthrough",
74 ))
75 })
76 })
77 });
78 command = command
79 .mut_subcommand("config", |sub| {
80 sub.about(crate::i18n::t(locale, "cli.command.config.about"))
81 .mut_subcommand("set", |sub| {
82 sub.about(crate::i18n::t(locale, "cli.command.config.set.about"))
83 .mut_arg("key", |arg| {
84 arg.help(crate::i18n::t(locale, "cli.command.config.set.key"))
85 })
86 .mut_arg("value", |arg| {
87 arg.help(crate::i18n::t(locale, "cli.command.config.set.value"))
88 })
89 .mut_arg("file", |arg| {
90 arg.help(crate::i18n::t(locale, "cli.command.config.set.file"))
91 })
92 })
93 })
94 .mut_subcommand("mcp", |sub| {
95 sub.about(crate::i18n::t(locale, "cli.command.mcp.about"))
96 .mut_subcommand("doctor", |sub| {
97 sub.about(crate::i18n::t(locale, "cli.command.mcp.doctor.about"))
98 .mut_arg("provider", |arg| {
99 arg.help(crate::i18n::t(locale, "cli.command.mcp.doctor.provider"))
100 })
101 .mut_arg("json", |arg| {
102 arg.help(crate::i18n::t(locale, "cli.command.mcp.doctor.json"))
103 })
104 })
105 })
106 .mut_subcommand("tools", |sub| {
107 sub.about(crate::i18n::t(locale, "cli.command.tools.about"))
108 .mut_subcommand("install", |sub| {
109 sub.about(crate::i18n::t(locale, "cli.command.tools.install.about"))
110 .mut_arg("latest", |arg| {
111 arg.help(crate::i18n::t(locale, "cli.command.tools.install.latest"))
112 })
113 })
114 })
115 .mut_subcommand("install", |sub| {
116 sub.about(crate::i18n::t(locale, "cli.command.install.about"))
117 .mut_subcommand("tools", |sub| {
118 sub.about(crate::i18n::t(locale, "cli.command.install.tools.about"))
119 .mut_arg("latest", |arg| {
120 arg.help(crate::i18n::t(locale, "cli.command.tools.install.latest"))
121 })
122 })
123 .mut_arg("tenant", |arg| {
124 arg.help(crate::i18n::t(locale, "cli.command.install.tenant"))
125 })
126 .mut_arg("token", |arg| {
127 arg.help(crate::i18n::t(locale, "cli.command.install.token"))
128 })
129 .mut_arg("bin_dir", |arg| {
130 arg.help(crate::i18n::t(locale, "cli.command.install.bin_dir"))
131 })
132 .mut_arg("docs_dir", |arg| {
133 arg.help(crate::i18n::t(locale, "cli.command.install.docs_dir"))
134 })
135 .mut_arg("locale", |arg| {
136 arg.help(crate::i18n::t(locale, "cli.command.install.locale"))
137 })
138 })
139 .mut_subcommand("release", |sub| {
140 sub.about(crate::i18n::t(locale, "cli.command.release.about"))
141 .mut_subcommand("generate", |sub| {
142 sub.about(crate::i18n::t(locale, "cli.command.release.generate.about"))
143 .mut_arg("release", |arg| {
144 arg.help(crate::i18n::t(locale, "cli.command.release.release"))
145 })
146 .mut_arg("from", |arg| {
147 arg.help(crate::i18n::t(locale, "cli.command.release.from"))
148 })
149 .mut_arg("repo", |arg| {
150 arg.help(crate::i18n::t(locale, "cli.command.release.repo"))
151 })
152 .mut_arg("token", |arg| {
153 arg.help(crate::i18n::t(locale, "cli.command.release.token"))
154 })
155 .mut_arg("out", |arg| {
156 arg.help(crate::i18n::t(locale, "cli.command.release.out"))
157 })
158 .mut_arg("dry_run", |arg| {
159 arg.help(crate::i18n::t(locale, "cli.command.release.dry_run"))
160 })
161 })
162 .mut_subcommand("publish", |sub| {
163 sub.about(crate::i18n::t(locale, "cli.command.release.publish.about"))
164 .mut_arg("release", |arg| {
165 arg.help(crate::i18n::t(locale, "cli.command.release.release"))
166 })
167 .mut_arg("from", |arg| {
168 arg.help(crate::i18n::t(locale, "cli.command.release.from"))
169 })
170 .mut_arg("tag", |arg| {
171 arg.help(crate::i18n::t(locale, "cli.command.release.tag"))
172 })
173 .mut_arg("manifest", |arg| {
174 arg.help(crate::i18n::t(locale, "cli.command.release.manifest"))
175 })
176 .mut_arg("repo", |arg| {
177 arg.help(crate::i18n::t(locale, "cli.command.release.repo"))
178 })
179 .mut_arg("token", |arg| {
180 arg.help(crate::i18n::t(locale, "cli.command.release.token"))
181 })
182 .mut_arg("out", |arg| {
183 arg.help(crate::i18n::t(locale, "cli.command.release.out"))
184 })
185 .mut_arg("dry_run", |arg| {
186 arg.help(crate::i18n::t(locale, "cli.command.release.dry_run"))
187 })
188 .mut_arg("force", |arg| {
189 arg.help(crate::i18n::t(locale, "cli.command.release.force"))
190 })
191 })
192 .mut_subcommand("view", |sub| {
193 sub.about(crate::i18n::t(locale, "cli.command.release.view.about"))
194 .mut_arg("release", |arg| {
195 arg.help(crate::i18n::t(locale, "cli.command.release.release"))
196 })
197 .mut_arg("tag", |arg| {
198 arg.help(crate::i18n::t(locale, "cli.command.release.tag"))
199 })
200 .mut_arg("repo", |arg| {
201 arg.help(crate::i18n::t(locale, "cli.command.release.repo"))
202 })
203 .mut_arg("token", |arg| {
204 arg.help(crate::i18n::t(locale, "cli.command.release.token"))
205 })
206 })
207 .mut_subcommand("dev", |sub| {
208 sub.about(crate::i18n::t(locale, "cli.command.release.dev.about"))
209 .mut_arg("repo", |arg| {
210 arg.help(crate::i18n::t(locale, "cli.command.release.repo"))
211 })
212 .mut_arg("token", |arg| {
213 arg.help(crate::i18n::t(locale, "cli.command.release.token"))
214 })
215 .mut_arg("dry_run", |arg| {
216 arg.help(crate::i18n::t(locale, "cli.command.release.dry_run"))
217 })
218 .mut_arg("force", |arg| {
219 arg.help(crate::i18n::t(locale, "cli.command.release.force"))
220 })
221 })
222 .mut_subcommand("promote", |sub| {
223 sub.about(crate::i18n::t(locale, "cli.command.release.promote.about"))
224 .mut_arg("release", |arg| {
225 arg.help(crate::i18n::t(locale, "cli.command.release.release"))
226 })
227 .mut_arg("tag", |arg| {
228 arg.help(crate::i18n::t(locale, "cli.command.release.tag"))
229 })
230 .mut_arg("repo", |arg| {
231 arg.help(crate::i18n::t(locale, "cli.command.release.repo"))
232 })
233 .mut_arg("token", |arg| {
234 arg.help(crate::i18n::t(locale, "cli.command.release.token"))
235 })
236 .mut_arg("dry_run", |arg| {
237 arg.help(crate::i18n::t(locale, "cli.command.release.dry_run"))
238 })
239 })
240 })
241 .mut_subcommand("cbor", |sub| {
242 sub.about(crate::i18n::t(locale, "cli.command.cbor.about"))
243 .mut_arg("path", |arg| {
244 arg.help(crate::i18n::t(locale, "cli.command.cbor.path"))
245 })
246 })
247 .mut_subcommand("coverage", |sub| {
248 sub.about(crate::i18n::t(locale, "cli.command.coverage.about"))
249 .mut_arg("skip_run", |arg| {
250 arg.help(crate::i18n::t(locale, "cli.command.coverage.skip_run"))
251 })
252 })
253 .mut_subcommand("wizard", |sub| {
254 sub.about(crate::i18n::t(locale, "cli.command.wizard.about"))
255 .mut_arg("answers", |arg| {
256 arg.help(crate::i18n::t(locale, "cli.command.wizard.answers"))
257 })
258 .mut_arg("frontend", |arg| {
259 arg.help(crate::i18n::t(locale, "cli.command.wizard.frontend"))
260 })
261 .mut_arg("locale", |arg| {
262 arg.help(crate::i18n::t(locale, "cli.command.wizard.locale"))
263 })
264 .mut_arg("emit_answers", |arg| {
265 arg.help(crate::i18n::t(locale, "cli.command.wizard.emit_answers"))
266 })
267 .mut_arg("schema", |arg| {
268 arg.help(crate::i18n::t(locale, "cli.command.wizard.schema"))
269 .long_help(crate::i18n::t(locale, "cli.command.wizard.schema_long"))
270 })
271 .mut_arg("schema_version", |arg| {
272 arg.help(crate::i18n::t(locale, "cli.command.wizard.schema_version"))
273 })
274 .mut_arg("migrate", |arg| {
275 arg.help(crate::i18n::t(locale, "cli.command.wizard.migrate"))
276 })
277 .mut_arg("out", |arg| {
278 arg.help(crate::i18n::t(locale, "cli.command.wizard.out"))
279 })
280 .mut_arg("dry_run", |arg| {
281 arg.help(crate::i18n::t(locale, "cli.command.wizard.dry_run"))
282 })
283 .mut_arg("yes", |arg| {
284 arg.help(crate::i18n::t(locale, "cli.command.wizard.yes"))
285 })
286 .mut_arg("non_interactive", |arg| {
287 arg.help(crate::i18n::t(locale, "cli.command.wizard.non_interactive"))
288 })
289 .mut_arg("unsafe_commands", |arg| {
290 arg.help(crate::i18n::t(locale, "cli.command.wizard.unsafe_commands"))
291 })
292 .mut_arg("allow_destructive", |arg| {
293 arg.help(crate::i18n::t(
294 locale,
295 "cli.command.wizard.allow_destructive",
296 ))
297 })
298 .mut_subcommand("validate", |sub| {
299 sub.about(crate::i18n::t(locale, "cli.command.wizard.validate.about"))
300 .mut_arg("answers", |arg| {
301 arg.help(crate::i18n::t(locale, "cli.command.wizard.answers"))
302 })
303 .mut_arg("frontend", |arg| {
304 arg.help(crate::i18n::t(locale, "cli.command.wizard.frontend"))
305 })
306 .mut_arg("locale", |arg| {
307 arg.help(crate::i18n::t(locale, "cli.command.wizard.locale"))
308 })
309 .mut_arg("emit_answers", |arg| {
310 arg.help(crate::i18n::t(locale, "cli.command.wizard.emit_answers"))
311 })
312 .mut_arg("schema_version", |arg| {
313 arg.help(crate::i18n::t(locale, "cli.command.wizard.schema_version"))
314 })
315 .mut_arg("migrate", |arg| {
316 arg.help(crate::i18n::t(locale, "cli.command.wizard.migrate"))
317 })
318 .mut_arg("out", |arg| {
319 arg.help(crate::i18n::t(locale, "cli.command.wizard.out"))
320 })
321 })
322 .mut_subcommand("apply", |sub| {
323 sub.about(crate::i18n::t(locale, "cli.command.wizard.apply.about"))
324 .mut_arg("answers", |arg| {
325 arg.help(crate::i18n::t(locale, "cli.command.wizard.answers"))
326 })
327 .mut_arg("frontend", |arg| {
328 arg.help(crate::i18n::t(locale, "cli.command.wizard.frontend"))
329 })
330 .mut_arg("locale", |arg| {
331 arg.help(crate::i18n::t(locale, "cli.command.wizard.locale"))
332 })
333 .mut_arg("emit_answers", |arg| {
334 arg.help(crate::i18n::t(locale, "cli.command.wizard.emit_answers"))
335 })
336 .mut_arg("schema_version", |arg| {
337 arg.help(crate::i18n::t(locale, "cli.command.wizard.schema_version"))
338 })
339 .mut_arg("migrate", |arg| {
340 arg.help(crate::i18n::t(locale, "cli.command.wizard.migrate"))
341 })
342 .mut_arg("out", |arg| {
343 arg.help(crate::i18n::t(locale, "cli.command.wizard.out"))
344 })
345 .mut_arg("yes", |arg| {
346 arg.help(crate::i18n::t(locale, "cli.command.wizard.yes"))
347 })
348 .mut_arg("non_interactive", |arg| {
349 arg.help(crate::i18n::t(locale, "cli.command.wizard.non_interactive"))
350 })
351 .mut_arg("unsafe_commands", |arg| {
352 arg.help(crate::i18n::t(locale, "cli.command.wizard.unsafe_commands"))
353 })
354 .mut_arg("allow_destructive", |arg| {
355 arg.help(crate::i18n::t(
356 locale,
357 "cli.command.wizard.allow_destructive",
358 ))
359 })
360 })
361 });
362
363 localize_help_tree(command, locale, true)
364}
365
366fn localize_help_tree(mut command: clap::Command, locale: &str, is_root: bool) -> clap::Command {
367 command = command
368 .disable_help_subcommand(true)
369 .disable_help_flag(true);
370 let arg_ids = command
371 .get_arguments()
372 .map(|arg| arg.get_id().as_str().to_string())
373 .collect::<Vec<_>>();
374 if arg_ids.iter().any(|id| id == "help") {
375 command = command.mut_arg("help", |arg| {
376 arg.help(crate::i18n::t(locale, "cli.help.flag"))
377 });
378 } else {
379 command = command.arg(
380 Arg::new("help")
381 .short('h')
382 .long("help")
383 .action(ArgAction::Help)
384 .help(crate::i18n::t(locale, "cli.help.flag")),
385 );
386 }
387 if is_root && arg_ids.iter().any(|id| id == "version") {
388 command = command.mut_arg("version", |arg| {
389 arg.help(crate::i18n::t(locale, "cli.version.flag"))
390 });
391 }
392
393 let sub_names = command
394 .get_subcommands()
395 .map(|sub| sub.get_name().to_string())
396 .collect::<Vec<_>>();
397 for name in sub_names {
398 command = command.mut_subcommand(name, |sub| localize_help_tree(sub, locale, false));
399 }
400
401 command
402}
403
404#[derive(Subcommand, Debug)]
405pub enum Command {
406 Flow(PassthroughArgs),
408 Pack(PassthroughArgs),
410 Component(PassthroughArgs),
412 Bundle(PassthroughArgs),
414 Runner(PassthroughArgs),
416 #[command(subcommand)]
418 Config(ConfigCommand),
419 Coverage(CoverageArgs),
421 #[command(subcommand)]
423 Mcp(McpCommand),
424 Gui(PassthroughArgs),
426 #[command(subcommand)]
428 Secrets(SecretsCommand),
429 #[command(subcommand)]
431 Tools(ToolsCommand),
432 Install(InstallArgs),
434 #[command(subcommand)]
436 Release(ReleaseCommand),
437 Cbor(CborArgs),
439 Wizard(Box<WizardCommand>),
441}
442
443#[derive(Args, Debug, Clone)]
444#[command(disable_help_flag = true)]
445pub struct PassthroughArgs {
446 #[arg(
448 value_name = "ARGS",
449 trailing_var_arg = true,
450 allow_hyphen_values = true
451 )]
452 pub args: Vec<OsString>,
453}
454
455#[derive(Subcommand, Debug)]
456pub enum McpCommand {
457 Doctor(McpDoctorArgs),
459}
460
461#[derive(Args, Debug)]
462pub struct McpDoctorArgs {
463 pub provider: String,
465 #[arg(long = "json")]
467 pub json: bool,
468}
469
470#[derive(Subcommand, Debug)]
471pub enum ConfigCommand {
472 Set(ConfigSetArgs),
474}
475
476#[derive(Subcommand, Debug)]
477pub enum ToolsCommand {
478 Install(ToolsInstallArgs),
480}
481
482#[derive(Subcommand, Debug)]
483pub enum InstallSubcommand {
484 Tools(ToolsInstallArgs),
486}
487
488#[derive(Subcommand, Debug)]
489pub enum ReleaseCommand {
490 Generate(ReleaseGenerateArgs),
492 Publish(ReleasePublishArgs),
494 View(ReleaseViewArgs),
496 Dev(ReleaseDevArgs),
498 Promote(ReleasePromoteArgs),
500}
501
502#[derive(Args, Debug)]
503pub struct InstallArgs {
504 #[command(subcommand)]
505 pub command: Option<InstallSubcommand>,
506 #[arg(long = "tenant")]
508 pub tenant: Option<String>,
509 #[arg(long = "token")]
511 pub token: Option<String>,
512 #[arg(long = "bin-dir")]
514 pub bin_dir: Option<PathBuf>,
515 #[arg(long = "docs-dir")]
517 pub docs_dir: Option<PathBuf>,
518 #[arg(long = "locale")]
520 pub locale: Option<String>,
521}
522
523#[derive(Args, Debug)]
524pub struct ToolsInstallArgs {
525 #[arg(long = "latest")]
527 pub latest: bool,
528}
529
530#[derive(Args, Debug)]
531pub struct ReleaseGenerateArgs {
532 #[arg(long = "release")]
534 pub release: String,
535 #[arg(long = "from", default_value = "dev")]
537 pub from: String,
538 #[arg(
540 long = "repo",
541 default_value = "ghcr.io/greenticai/greentic-versions/gtc"
542 )]
543 pub repo: String,
544 #[arg(long = "token")]
546 pub token: Option<String>,
547 #[arg(long = "out", default_value = "dist/toolchains")]
549 pub out: PathBuf,
550 #[arg(long = "dry-run")]
552 pub dry_run: bool,
553}
554
555#[derive(Args, Debug)]
556pub struct ReleasePublishArgs {
557 #[arg(long = "release", required_unless_present = "manifest")]
559 pub release: Option<String>,
560 #[arg(long = "from", default_value = "dev", requires = "release")]
562 pub from: Option<String>,
563 #[arg(long = "tag")]
565 pub tag: Option<String>,
566 #[arg(long = "manifest", required_unless_present = "release")]
568 pub manifest: Option<PathBuf>,
569 #[arg(
571 long = "repo",
572 default_value = "ghcr.io/greenticai/greentic-versions/gtc"
573 )]
574 pub repo: String,
575 #[arg(long = "token")]
577 pub token: Option<String>,
578 #[arg(long = "out", default_value = "dist/toolchains")]
580 pub out: PathBuf,
581 #[arg(long = "dry-run")]
583 pub dry_run: bool,
584 #[arg(long = "force")]
586 pub force: bool,
587}
588
589#[derive(Args, Debug)]
590pub struct ReleaseViewArgs {
591 #[arg(
593 long = "release",
594 conflicts_with = "tag",
595 required_unless_present = "tag"
596 )]
597 pub release: Option<String>,
598 #[arg(
600 long = "tag",
601 conflicts_with = "release",
602 required_unless_present = "release"
603 )]
604 pub tag: Option<String>,
605 #[arg(
607 long = "repo",
608 default_value = "ghcr.io/greenticai/greentic-versions/gtc"
609 )]
610 pub repo: String,
611 #[arg(long = "token")]
613 pub token: Option<String>,
614}
615
616#[derive(Args, Debug)]
617pub struct ReleaseDevArgs {
618 #[arg(
620 long = "repo",
621 default_value = "ghcr.io/greenticai/greentic-versions/gtc"
622 )]
623 pub repo: String,
624 #[arg(long = "token")]
626 pub token: Option<String>,
627 #[arg(long = "dry-run")]
629 pub dry_run: bool,
630 #[arg(long = "force")]
632 pub force: bool,
633}
634
635#[derive(Args, Debug)]
636pub struct ReleasePromoteArgs {
637 #[arg(long = "release")]
639 pub release: String,
640 #[arg(long = "tag")]
642 pub tag: String,
643 #[arg(
645 long = "repo",
646 default_value = "ghcr.io/greenticai/greentic-versions/gtc"
647 )]
648 pub repo: String,
649 #[arg(long = "token")]
651 pub token: Option<String>,
652 #[arg(long = "dry-run")]
654 pub dry_run: bool,
655}
656
657#[derive(Args, Debug)]
658pub struct ConfigSetArgs {
659 pub key: String,
661 pub value: String,
663 #[arg(long = "file")]
665 pub file: Option<PathBuf>,
666}
667
668#[derive(Args, Debug)]
669pub struct CborArgs {
670 #[arg(value_name = "PATH")]
672 pub path: PathBuf,
673}
674
675#[derive(Args, Debug, Clone)]
676pub struct CoverageArgs {
677 #[arg(long = "skip-run")]
679 pub skip_run: bool,
680}
681
682#[derive(Args, Debug, Clone)]
683pub struct WizardCommand {
684 #[command(subcommand)]
685 pub command: Option<WizardSubcommand>,
686 #[command(flatten)]
687 pub launch: WizardLaunchArgs,
688}
689
690#[derive(Subcommand, Debug, Clone)]
691pub enum WizardSubcommand {
692 Validate(WizardValidateArgs),
694 Apply(WizardApplyArgs),
696}
697
698#[derive(Args, Debug, Clone)]
699pub struct WizardLaunchArgs {
700 #[arg(long = "answers")]
702 pub answers: Option<String>,
703 #[arg(long = "frontend", default_value = "json")]
705 pub frontend: String,
706 #[arg(long = "locale")]
708 pub locale: Option<String>,
709 #[arg(long = "emit-answers")]
711 pub emit_answers: Option<PathBuf>,
712 #[arg(long = "schema")]
714 pub schema: bool,
715 #[arg(long = "schema-version")]
717 pub schema_version: Option<String>,
718 #[arg(long = "migrate")]
720 pub migrate: bool,
721 #[arg(long = "out")]
723 pub out: Option<PathBuf>,
724 #[arg(long = "dry-run")]
726 pub dry_run: bool,
727 #[arg(long = "yes")]
729 pub yes: bool,
730 #[arg(long = "non-interactive")]
732 pub non_interactive: bool,
733 #[arg(long = "unsafe-commands")]
735 pub unsafe_commands: bool,
736 #[arg(long = "allow-destructive")]
738 pub allow_destructive: bool,
739}
740
741#[derive(Args, Debug, Clone)]
742pub struct WizardValidateArgs {
743 #[arg(long = "answers")]
745 pub answers: String,
746 #[arg(long = "frontend", default_value = "json")]
748 pub frontend: String,
749 #[arg(long = "locale")]
751 pub locale: Option<String>,
752 #[arg(long = "emit-answers")]
754 pub emit_answers: Option<PathBuf>,
755 #[arg(long = "schema-version")]
757 pub schema_version: Option<String>,
758 #[arg(long = "migrate")]
760 pub migrate: bool,
761 #[arg(long = "out")]
763 pub out: Option<PathBuf>,
764}
765
766#[derive(Args, Debug, Clone)]
767pub struct WizardApplyArgs {
768 #[arg(long = "answers")]
770 pub answers: String,
771 #[arg(long = "frontend", default_value = "json")]
773 pub frontend: String,
774 #[arg(long = "locale")]
776 pub locale: Option<String>,
777 #[arg(long = "emit-answers")]
779 pub emit_answers: Option<PathBuf>,
780 #[arg(long = "schema-version")]
782 pub schema_version: Option<String>,
783 #[arg(long = "migrate")]
785 pub migrate: bool,
786 #[arg(long = "out")]
788 pub out: Option<PathBuf>,
789 #[arg(long = "yes")]
791 pub yes: bool,
792 #[arg(long = "non-interactive")]
794 pub non_interactive: bool,
795 #[arg(long = "unsafe-commands")]
797 pub unsafe_commands: bool,
798 #[arg(long = "allow-destructive")]
800 pub allow_destructive: bool,
801}