diff --git a/src/commands/create/custom_opts.rs b/src/commands/create/custom_opts.rs index 34b94f7..14d4a2b 100644 --- a/src/commands/create/custom_opts.rs +++ b/src/commands/create/custom_opts.rs @@ -63,6 +63,9 @@ pub struct CustomOptions { #[clap(long)] pub print_libvirt_xml: bool, + + #[clap(long, conflicts_with = "print_libvirt_xml")] + pub print_config_json: bool, } impl CustomOptions { diff --git a/src/commands/create/mod.rs b/src/commands/create/mod.rs index 799040b..d092c86 100644 --- a/src/commands/create/mod.rs +++ b/src/commands/create/mod.rs @@ -151,9 +151,12 @@ fn set_up_container_root( // configure container entrypoint - let command = match custom_options.print_libvirt_xml { - true => vec!["cat", "/crun-vm/domain.xml"], - false => vec!["/crun-vm/entrypoint.sh"], + let command = if custom_options.print_libvirt_xml { + vec!["cat", "/crun-vm/domain.xml"] + } else if custom_options.print_config_json { + vec!["cat", "/crun-vm/config.json"] + } else { + vec!["/crun-vm/entrypoint.sh"] }; spec.set_process({