bin: Fix wrapping in help strings

Some of the help strings had extra newlines in them or otherwise strange
wrapping. The strings were rewrapped with the nightly version of rustfmt
that supports string formatting.

Fixes: #899

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-03-12 16:05:28 +00:00
parent ee1ba56cfe
commit ca3b39c0be
3 changed files with 33 additions and 42 deletions

View File

@@ -24,8 +24,8 @@ fn main() {
Arg::with_name("block-backend") Arg::with_name("block-backend")
.long("block-backend") .long("block-backend")
.help( .help(
"vhost-user-block backend parameters \"image=<image_path>,\ "vhost-user-block backend parameters \
sock=<socket_path>,num_queues=<number_of_queues>,\ \"image=<image_path>,sock=<socket_path>,num_queues=<number_of_queues>,\
readonly=true|false,direct=true|false,poll_queue=true|false\"", readonly=true|false,direct=true|false,poll_queue=true|false\"",
) )
.takes_value(true) .takes_value(true)

View File

@@ -22,11 +22,9 @@ fn main() {
Arg::with_name("net-backend") Arg::with_name("net-backend")
.long("net-backend") .long("net-backend")
.help( .help(
"vhost-user-net backend parameters \"ip=<ip_addr>,\ "vhost-user-net backend parameters \
mask=<net_mask>,sock=<socket_path>,\ \"ip=<ip_addr>,mask=<net_mask>,sock=<socket_path>,\
num_queues=<number_of_queues>,\ num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,tap=<if_name>\"",
queue_size=<size_of_each_queue>,\
tap=<if_name>\"",
) )
.takes_value(true) .takes_value(true)
.min_values(1), .min_values(1),

View File

@@ -97,8 +97,8 @@ fn create_app<'a, 'b>(
Arg::with_name("memory") Arg::with_name("memory")
.long("memory") .long("memory")
.help( .help(
"Memory parameters \"size=<guest_memory_size>,\ "Memory parameters \
file=<backing_file_path>,mergeable=on|off,\ \"size=<guest_memory_size>,file=<backing_file_path>,mergeable=on|off,\
hotplug_size=<hotpluggable_memory_size>\"", hotplug_size=<hotpluggable_memory_size>\"",
) )
.default_value(&default_memory) .default_value(&default_memory)
@@ -122,11 +122,10 @@ fn create_app<'a, 'b>(
Arg::with_name("disk") Arg::with_name("disk")
.long("disk") .long("disk")
.help( .help(
"Disk parameters \"path=<disk_image_path>,\ "Disk parameters \
readonly=on|off,iommu=on|off,\ \"path=<disk_image_path>,readonly=on|off,iommu=on|off,\
num_queues=<number_of_queues>,\ num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,\
queue_size=<size_of_each_queue>, vhost_user=<vhost_user_enable>,socket=<vhost_user_socket_path>,\
vhost_user=<vhost_user_enable>,socket=<vhost_user_socket_path>,
wce=<true|false, default true>\"", wce=<true|false, default true>\"",
) )
.takes_value(true) .takes_value(true)
@@ -137,10 +136,9 @@ fn create_app<'a, 'b>(
Arg::with_name("net") Arg::with_name("net")
.long("net") .long("net")
.help( .help(
"Network parameters \"tap=<if_name>,\ "Network parameters \
ip=<ip_addr>,mask=<net_mask>,mac=<mac_addr>,\ \"tap=<if_name>,ip=<ip_addr>,mask=<net_mask>,mac=<mac_addr>,iommu=on|off,\
iommu=on|off,num_queues=<number_of_queues>,\ num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,\
queue_size=<size_of_each_queue>,\
vhost_user=<vhost_user_enable>,socket=<vhost_user_socket_path>\"", vhost_user=<vhost_user_enable>,socket=<vhost_user_socket_path>\"",
) )
.takes_value(true) .takes_value(true)
@@ -151,8 +149,7 @@ fn create_app<'a, 'b>(
Arg::with_name("rng") Arg::with_name("rng")
.long("rng") .long("rng")
.help( .help(
"Random number generator parameters \ "Random number generator parameters \"src=<entropy_source_path>,iommu=on|off\"",
\"src=<entropy_source_path>,iommu=on|off\"",
) )
.default_value(&default_rng) .default_value(&default_rng)
.group("vm-config"), .group("vm-config"),
@@ -161,10 +158,10 @@ fn create_app<'a, 'b>(
Arg::with_name("fs") Arg::with_name("fs")
.long("fs") .long("fs")
.help( .help(
"virtio-fs parameters \"tag=<tag_name>,\ "virtio-fs parameters \
sock=<socket_path>,num_queues=<number_of_queues>,\ \"tag=<tag_name>,sock=<socket_path>,num_queues=<number_of_queues>,\
queue_size=<size_of_each_queue>,dax=on|off,\ queue_size=<size_of_each_queue>,dax=on|off,cache_size=<DAX cache size: \
cache_size=<DAX cache size: default 8Gib>\"", default 8Gib>\"",
) )
.takes_value(true) .takes_value(true)
.min_values(1) .min_values(1)
@@ -174,8 +171,9 @@ fn create_app<'a, 'b>(
Arg::with_name("pmem") Arg::with_name("pmem")
.long("pmem") .long("pmem")
.help( .help(
"Persistent memory parameters \"file=<backing_file_path>,\ "Persistent memory parameters \
size=<persistent_memory_size>,iommu=on|off,mergeable=on|off\"", \"file=<backing_file_path>,size=<persistent_memory_size>,iommu=on|off,\
mergeable=on|off\"",
) )
.takes_value(true) .takes_value(true)
.min_values(1) .min_values(1)
@@ -192,8 +190,7 @@ fn create_app<'a, 'b>(
Arg::with_name("console") Arg::with_name("console")
.long("console") .long("console")
.help( .help(
"Control (virtio) console: \"off|null|tty|file=/path/to/a/file,\ "Control (virtio) console: \"off|null|tty|file=/path/to/a/file,iommu=on|off\"",
iommu=on|off\"",
) )
.default_value("tty") .default_value("tty")
.group("vm-config"), .group("vm-config"),
@@ -213,9 +210,8 @@ fn create_app<'a, 'b>(
Arg::with_name("vhost-user-net") Arg::with_name("vhost-user-net")
.long("vhost-user-net") .long("vhost-user-net")
.help( .help(
"Network parameters \"mac=<mac_addr>,\ "Network parameters \"mac=<mac_addr>,sock=<socket_path>, \
sock=<socket_path>, num_queues=<number_of_queues>,\ num_queues=<number_of_queues>,queue_size=<size_of_each_queue>\"",
queue_size=<size_of_each_queue>\"",
) )
.takes_value(true) .takes_value(true)
.min_values(1) .min_values(1)
@@ -225,8 +221,7 @@ fn create_app<'a, 'b>(
Arg::with_name("vsock") Arg::with_name("vsock")
.long("vsock") .long("vsock")
.help( .help(
"Virtio VSOCK parameters \"cid=<context_id>,\ "Virtio VSOCK parameters \"cid=<context_id>,sock=<socket_path>,iommu=on|off\"",
sock=<socket_path>,iommu=on|off\"",
) )
.takes_value(true) .takes_value(true)
.min_values(1) .min_values(1)
@@ -260,11 +255,9 @@ fn create_app<'a, 'b>(
Arg::with_name("net-backend") Arg::with_name("net-backend")
.long("net-backend") .long("net-backend")
.help( .help(
"vhost-user-net backend parameters \"ip=<ip_addr>,\ "vhost-user-net backend parameters \
mask=<net_mask>,sock=<socket_path>,\ \"ip=<ip_addr>,mask=<net_mask>,sock=<socket_path>,\
num_queues=<number_of_queues>,\ num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,tap=<if_name>\"",
queue_size=<size_of_each_queue>,\
tap=<if_name>\"",
) )
.takes_value(true) .takes_value(true)
.conflicts_with_all(&["block-backend", "kernel"]) .conflicts_with_all(&["block-backend", "kernel"])
@@ -274,8 +267,8 @@ fn create_app<'a, 'b>(
Arg::with_name("block-backend") Arg::with_name("block-backend")
.long("block-backend") .long("block-backend")
.help( .help(
"vhost-user-block backend parameters \"image=<image_path>,\ "vhost-user-block backend parameters \
sock=<socket_path>,num_queues=<number_of_queues>,\ \"image=<image_path>,sock=<socket_path>,num_queues=<number_of_queues>,\
readonly=true|false,direct=true|false,poll_queue=true|false\"", readonly=true|false,direct=true|false,poll_queue=true|false\"",
) )
.takes_value(true) .takes_value(true)
@@ -299,8 +292,8 @@ fn start_vmm(cmd_arguments: ArgMatches) {
.expect("Missing argument: api-socket"); .expect("Missing argument: api-socket");
println!( println!(
"Cloud Hypervisor Guest\n\tAPI server: {}\n\tvCPUs: {}\n\tMemory: {} MB\ "Cloud Hypervisor Guest\n\tAPI server: {}\n\tvCPUs: {}\n\tMemory: {} MB\n\tKernel: \
\n\tKernel: {:?}\n\tKernel cmdline: {}\n\tDisk(s): {:?}", {:?}\n\tKernel cmdline: {}\n\tDisk(s): {:?}",
api_socket_path, api_socket_path,
vm_config.cpus.boot_vcpus, vm_config.cpus.boot_vcpus,
vm_config.memory.size >> 20, vm_config.memory.size >> 20,