diff --git a/README.md b/README.md index 502acc2..780d150 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Command-line applications for local and remote management are provided as well - `vmmp_request`: creates a certificate signing request containing a command - `vmmp_ca`: certificate authority operations: sign, generate (and revoke) -Please read [the blog article](https://hannes.nqsb.io/Posts/VMM) for motivation +Please read [the (outdated) blog article](https://hannes.nqsb.io/Posts/VMM) for motivation and an overview. The implementation uses explicit errors (no exceptions), and make mostly use of diff --git a/app/vmm_cli.ml b/app/vmm_cli.ml index 6f2d892..6292dac 100644 --- a/app/vmm_cli.ml +++ b/app/vmm_cli.ml @@ -101,7 +101,7 @@ let cpus = let vms = let doc = "Number of VMs to allow" in - Arg.(required & pos 0 (some int) None & info [] ~doc) + Arg.(required & pos 0 (some int) None & info [] ~doc ~docv:"VMS") let block_size = let doc = "Block storage to allow" in diff --git a/app/vmm_provision.ml b/app/vmm_provision.ml index c079c15..48b1580 100644 --- a/app/vmm_provision.ml +++ b/app/vmm_provision.ml @@ -81,11 +81,11 @@ open Cmdliner let nam = let doc = "Name to provision" in - Arg.(required & pos 0 (some string) None & info [] ~doc) + Arg.(required & pos 0 (some string) None & info [] ~doc ~docv:"VM") let cacert = let doc = "cacert" in - Arg.(required & pos 1 (some file) None & info [] ~doc) + Arg.(required & pos 1 (some file) None & info [] ~doc ~docv:"CACERT") let key = let doc = "Private key" in @@ -93,8 +93,8 @@ let key = let db = let doc = "Database" in - Arg.(required & pos 0 (some string) None & info [] ~doc) + Arg.(required & pos 0 (some string) None & info [] ~doc ~docv:"DB") let mem = let doc = "Memory to provision" in - Arg.(required & pos 2 (some int) None & info [] ~doc) + Arg.(required & pos 2 (some int) None & info [] ~doc ~docv:"MEM") diff --git a/app/vmmc_bistro.ml b/app/vmmc_bistro.ml index 76cc3db..31e0c8a 100644 --- a/app/vmmc_bistro.ml +++ b/app/vmmc_bistro.ml @@ -135,16 +135,16 @@ let ca_key = Arg.(value & opt string "ca.key" & info [ "ca-key" ] ~doc) let destination = - Arg.(required & pos 0 (some host_port) None & info [] ~docv:"destination" - ~doc:"the destination hostname:port to connect to") + let doc = "the destination hostname:port to connect to" in + Arg.(required & pos 0 (some host_port) None & info [] ~doc ~docv:"HOST:PORT") let image = let doc = "File of virtual machine image." in - Arg.(required & pos 2 (some file) None & info [] ~doc) + 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) + Arg.(required & pos 1 (some vm_c) None & info [] ~doc ~docv:"VM") let destroy_cmd = let doc = "destroys a virtual machine" in diff --git a/app/vmmc_local.ml b/app/vmmc_local.ml index 683b2f6..c3be718 100644 --- a/app/vmmc_local.ml +++ b/app/vmmc_local.ml @@ -99,11 +99,11 @@ let socket = let image = let doc = "File of virtual machine image." in - Arg.(required & pos 1 (some file) None & info [] ~doc) + 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) + Arg.(required & pos 0 (some vm_c) None & info [] ~doc ~docv:"VM") let destroy_cmd = let doc = "destroys a virtual machine" in diff --git a/app/vmmc_remote.ml b/app/vmmc_remote.ml index 5a717db..0aff0f5 100644 --- a/app/vmmc_remote.ml +++ b/app/vmmc_remote.ml @@ -47,19 +47,19 @@ open Vmm_cli let cas = let doc = "The full path to PEM encoded certificate authorities. Can either be a FILE or a DIRECTORY." in - Arg.(required & pos 0 (some string) None & info [] ~docv:"FILE" ~doc) + Arg.(required & pos 0 (some string) None & info [] ~doc ~docv:"CA") let client_cert = let doc = "Use a client certificate chain" in - Arg.(required & pos 1 (some file) None & info [] ~doc) + Arg.(required & pos 1 (some file) None & info [] ~doc ~docv:"CERT") let client_key = let doc = "Use a client key" in - Arg.(required & pos 2 (some file) None & info [] ~doc) + Arg.(required & pos 2 (some file) None & info [] ~doc ~docv:"KEY") let destination = - Arg.(required & pos 3 (some host_port) None & info [] ~docv:"destination" - ~doc:"the destination hostname:port to connect to") + let doc = "the destination hostname:port to connect to" in + Arg.(required & pos 3 (some host_port) None & info [] ~docv:"HOST:PORT" ~doc) let cmd = let doc = "VMM remote TLS client" in diff --git a/app/vmmd_influx.ml b/app/vmmd_influx.ml index 22812bf..69d5579 100644 --- a/app/vmmd_influx.ml +++ b/app/vmmd_influx.ml @@ -287,7 +287,7 @@ let socket = Arg.(value & opt string (Vmm_core.socket_path `Stats) & info [ "socket" ] ~doc) let influx = - Arg.(required & pos 0 (some host_port) None & info [] ~docv:"influx" + Arg.(required & pos 0 (some host_port) None & info [] ~docv:"INFLUXHOST:INFLUXPORT" ~doc:"the influx hostname:port to connect to") let cmd = diff --git a/app/vmmd_tls.ml b/app/vmmd_tls.ml index 2d5cc65..b074887 100644 --- a/app/vmmd_tls.ml +++ b/app/vmmd_tls.ml @@ -180,15 +180,15 @@ open Vmm_cli let cacert = let doc = "CA certificate" in - Arg.(required & pos 0 (some file) None & info [] ~doc) + Arg.(required & pos 0 (some file) None & info [] ~doc ~docv:"CA") let cert = let doc = "Certificate" in - Arg.(required & pos 1 (some file) None & info [] ~doc) + Arg.(required & pos 1 (some file) None & info [] ~doc ~docv:"CERT") let key = let doc = "Private key" in - Arg.(required & pos 2 (some file) None & info [] ~doc) + Arg.(required & pos 2 (some file) None & info [] ~doc ~docv:"KEY") let port = let doc = "TCP listen port" in diff --git a/app/vmmp_ca.ml b/app/vmmp_ca.ml index f4e9de8..73a1870 100644 --- a/app/vmmp_ca.ml +++ b/app/vmmp_ca.ml @@ -97,11 +97,11 @@ open Vmm_cli let csr = let doc = "signing request" in - Arg.(required & pos 3 (some file) None & info [] ~doc) + Arg.(required & pos 3 (some file) None & info [] ~doc ~docv:"CSR") let key = let doc = "Private key" in - Arg.(required & pos 2 (some file) None & info [] ~doc) + Arg.(required & pos 2 (some file) None & info [] ~doc ~docv:"KEY") let days = let doc = "Number of days" in @@ -109,7 +109,7 @@ let days = let db = let doc = "Database" in - Arg.(required & pos 1 (some string) None & info [] ~doc) + Arg.(required & pos 1 (some string) None & info [] ~doc ~docv:"DB") let sname = let doc = "Server name" in diff --git a/app/vmmp_request.ml b/app/vmmp_request.ml index 5d030e0..7ee24eb 100644 --- a/app/vmmp_request.ml +++ b/app/vmmp_request.ml @@ -64,11 +64,11 @@ open Vmm_cli let image = let doc = "File of virtual machine image." in - Arg.(required & pos 1 (some file) None & info [] ~doc) + 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) + Arg.(required & pos 0 (some vm_c) None & info [] ~doc ~docv:"VM") let destroy_cmd = let doc = "destroys a virtual machine" in