make destination optional in vmmc_bistro, make vm_name required in add_policy

This commit is contained in:
Hannes Mehnert 2018-10-31 23:41:22 +01:00
parent 65d31ba565
commit bed90d7a0b
4 changed files with 13 additions and 29 deletions

View file

@ -99,7 +99,15 @@ let cpus =
let vms = let vms =
let doc = "Number of VMs to allow" in let doc = "Number of VMs to allow" in
Arg.(required & pos 0 (some int) None & info [] ~doc ~docv:"VMS") Arg.(required & pos 1 (some int) None & info [] ~doc ~docv:"VMS")
let image =
let doc = "File of virtual machine image." in
Arg.(required & pos 1 (some file) None & info [] ~doc ~docv:"IMAGE")
let vm_name =
let doc = "Name virtual machine." in
Arg.(required & pos 0 (some vm_c) None & info [] ~doc ~docv:"VM")
let block_size = let block_size =
let doc = "Block storage to allow in MB" in let doc = "Block storage to allow in MB" in

View file

@ -129,15 +129,7 @@ let ca_key =
let destination = let destination =
let doc = "the destination hostname:port to connect to" in let doc = "the destination hostname:port to connect to" in
Arg.(required & pos 0 (some host_port) None & info [] ~doc ~docv:"HOST:PORT") Arg.(value & opt host_port ("localhost", 1025) & info [ "d" ; "destination" ] ~doc ~docv:"HOST:PORT")
let image =
let doc = "File of virtual machine image." in
Arg.(required & pos 2 (some file) None & info [] ~doc ~docv:"IMAGE")
let vm_name =
let doc = "Name virtual machine." in
Arg.(required & pos 1 (some vm_c) None & info [] ~doc ~docv:"VM")
let destroy_cmd = let destroy_cmd =
let doc = "destroys a virtual machine" in let doc = "destroys a virtual machine" in
@ -181,7 +173,7 @@ let add_policy_cmd =
[`S "DESCRIPTION"; [`S "DESCRIPTION";
`P "Adds a policy."] `P "Adds a policy."]
in in
Term.(ret (const add_policy $ setup_log $ destination $ ca_cert $ ca_key $ server_ca $ opt_vm_name $ vms $ mem $ cpus $ block_size $ bridge)), Term.(ret (const add_policy $ setup_log $ destination $ ca_cert $ ca_key $ server_ca $ vm_name $ vms $ mem $ cpus $ block_size $ bridge)),
Term.info "add_policy" ~doc ~man Term.info "add_policy" ~doc ~man
let create_cmd = let create_cmd =

View file

@ -97,14 +97,6 @@ let socket =
let doc = "Socket to connect to" in let doc = "Socket to connect to" in
Arg.(value & opt (some string) None & info [ "socket" ] ~doc) Arg.(value & opt (some string) None & info [ "socket" ] ~doc)
let image =
let doc = "File of virtual machine image." in
Arg.(required & pos 1 (some file) None & info [] ~doc ~docv:"IMAGE")
let vm_name =
let doc = "Name virtual machine." in
Arg.(required & pos 0 (some vm_c) None & info [] ~doc ~docv:"VM")
let destroy_cmd = let destroy_cmd =
let doc = "destroys a virtual machine" in let doc = "destroys a virtual machine" in
let man = let man =
@ -147,7 +139,7 @@ let add_policy_cmd =
[`S "DESCRIPTION"; [`S "DESCRIPTION";
`P "Adds a policy."] `P "Adds a policy."]
in in
Term.(ret (const add_policy $ setup_log $ socket $ opt_vm_name $ vms $ mem $ cpus $ block_size $ bridge)), Term.(ret (const add_policy $ setup_log $ socket $ vm_name $ vms $ mem $ cpus $ block_size $ bridge)),
Term.info "add_policy" ~doc ~man Term.info "add_policy" ~doc ~man
let create_cmd = let create_cmd =

View file

@ -62,14 +62,6 @@ let help _ man_format cmds = function
open Cmdliner open Cmdliner
open Vmm_cli open Vmm_cli
let image =
let doc = "File of virtual machine image." in
Arg.(required & pos 1 (some file) None & info [] ~doc ~docv:"IMAGE")
let vm_name =
let doc = "Name virtual machine." in
Arg.(required & pos 0 (some vm_c) None & info [] ~doc ~docv:"VM")
let destroy_cmd = let destroy_cmd =
let doc = "destroys a virtual machine" in let doc = "destroys a virtual machine" in
let man = let man =
@ -112,7 +104,7 @@ let add_policy_cmd =
[`S "DESCRIPTION"; [`S "DESCRIPTION";
`P "Adds a policy."] `P "Adds a policy."]
in in
Term.(ret (const add_policy $ setup_log $ opt_vm_name $ vms $ mem $ cpus $ block_size $ bridge)), Term.(ret (const add_policy $ setup_log $ vm_name $ vms $ mem $ cpus $ block_size $ bridge)),
Term.info "add_policy" ~doc ~man Term.info "add_policy" ~doc ~man
let create_cmd = let create_cmd =