From ca3b39c0beea337b9034355913d040091c77b45a Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 12 Mar 2020 16:05:28 +0000 Subject: [PATCH] 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 --- src/bin/vhost_user_blk.rs | 4 +-- src/bin/vhost_user_net.rs | 8 ++--- src/main.rs | 63 +++++++++++++++++---------------------- 3 files changed, 33 insertions(+), 42 deletions(-) diff --git a/src/bin/vhost_user_blk.rs b/src/bin/vhost_user_blk.rs index 0e8f3b8c2..c7f84b65f 100644 --- a/src/bin/vhost_user_blk.rs +++ b/src/bin/vhost_user_blk.rs @@ -24,8 +24,8 @@ fn main() { Arg::with_name("block-backend") .long("block-backend") .help( - "vhost-user-block backend parameters \"image=,\ - sock=,num_queues=,\ + "vhost-user-block backend parameters \ + \"image=,sock=,num_queues=,\ readonly=true|false,direct=true|false,poll_queue=true|false\"", ) .takes_value(true) diff --git a/src/bin/vhost_user_net.rs b/src/bin/vhost_user_net.rs index 308ed0ec4..520bb0fe8 100644 --- a/src/bin/vhost_user_net.rs +++ b/src/bin/vhost_user_net.rs @@ -22,11 +22,9 @@ fn main() { Arg::with_name("net-backend") .long("net-backend") .help( - "vhost-user-net backend parameters \"ip=,\ - mask=,sock=,\ - num_queues=,\ - queue_size=,\ - tap=\"", + "vhost-user-net backend parameters \ + \"ip=,mask=,sock=,\ + num_queues=,queue_size=,tap=\"", ) .takes_value(true) .min_values(1), diff --git a/src/main.rs b/src/main.rs index bd07033f7..45f482d3e 100755 --- a/src/main.rs +++ b/src/main.rs @@ -97,8 +97,8 @@ fn create_app<'a, 'b>( Arg::with_name("memory") .long("memory") .help( - "Memory parameters \"size=,\ - file=,mergeable=on|off,\ + "Memory parameters \ + \"size=,file=,mergeable=on|off,\ hotplug_size=\"", ) .default_value(&default_memory) @@ -122,11 +122,10 @@ fn create_app<'a, 'b>( Arg::with_name("disk") .long("disk") .help( - "Disk parameters \"path=,\ - readonly=on|off,iommu=on|off,\ - num_queues=,\ - queue_size=, - vhost_user=,socket=, + "Disk parameters \ + \"path=,readonly=on|off,iommu=on|off,\ + num_queues=,queue_size=,\ + vhost_user=,socket=,\ wce=\"", ) .takes_value(true) @@ -137,10 +136,9 @@ fn create_app<'a, 'b>( Arg::with_name("net") .long("net") .help( - "Network parameters \"tap=,\ - ip=,mask=,mac=,\ - iommu=on|off,num_queues=,\ - queue_size=,\ + "Network parameters \ + \"tap=,ip=,mask=,mac=,iommu=on|off,\ + num_queues=,queue_size=,\ vhost_user=,socket=\"", ) .takes_value(true) @@ -151,8 +149,7 @@ fn create_app<'a, 'b>( Arg::with_name("rng") .long("rng") .help( - "Random number generator parameters \ - \"src=,iommu=on|off\"", + "Random number generator parameters \"src=,iommu=on|off\"", ) .default_value(&default_rng) .group("vm-config"), @@ -161,10 +158,10 @@ fn create_app<'a, 'b>( Arg::with_name("fs") .long("fs") .help( - "virtio-fs parameters \"tag=,\ - sock=,num_queues=,\ - queue_size=,dax=on|off,\ - cache_size=\"", + "virtio-fs parameters \ + \"tag=,sock=,num_queues=,\ + queue_size=,dax=on|off,cache_size=\"", ) .takes_value(true) .min_values(1) @@ -174,8 +171,9 @@ fn create_app<'a, 'b>( Arg::with_name("pmem") .long("pmem") .help( - "Persistent memory parameters \"file=,\ - size=,iommu=on|off,mergeable=on|off\"", + "Persistent memory parameters \ + \"file=,size=,iommu=on|off,\ + mergeable=on|off\"", ) .takes_value(true) .min_values(1) @@ -192,8 +190,7 @@ fn create_app<'a, 'b>( Arg::with_name("console") .long("console") .help( - "Control (virtio) console: \"off|null|tty|file=/path/to/a/file,\ - iommu=on|off\"", + "Control (virtio) console: \"off|null|tty|file=/path/to/a/file,iommu=on|off\"", ) .default_value("tty") .group("vm-config"), @@ -213,9 +210,8 @@ fn create_app<'a, 'b>( Arg::with_name("vhost-user-net") .long("vhost-user-net") .help( - "Network parameters \"mac=,\ - sock=, num_queues=,\ - queue_size=\"", + "Network parameters \"mac=,sock=, \ + num_queues=,queue_size=\"", ) .takes_value(true) .min_values(1) @@ -225,8 +221,7 @@ fn create_app<'a, 'b>( Arg::with_name("vsock") .long("vsock") .help( - "Virtio VSOCK parameters \"cid=,\ - sock=,iommu=on|off\"", + "Virtio VSOCK parameters \"cid=,sock=,iommu=on|off\"", ) .takes_value(true) .min_values(1) @@ -260,11 +255,9 @@ fn create_app<'a, 'b>( Arg::with_name("net-backend") .long("net-backend") .help( - "vhost-user-net backend parameters \"ip=,\ - mask=,sock=,\ - num_queues=,\ - queue_size=,\ - tap=\"", + "vhost-user-net backend parameters \ + \"ip=,mask=,sock=,\ + num_queues=,queue_size=,tap=\"", ) .takes_value(true) .conflicts_with_all(&["block-backend", "kernel"]) @@ -274,8 +267,8 @@ fn create_app<'a, 'b>( Arg::with_name("block-backend") .long("block-backend") .help( - "vhost-user-block backend parameters \"image=,\ - sock=,num_queues=,\ + "vhost-user-block backend parameters \ + \"image=,sock=,num_queues=,\ readonly=true|false,direct=true|false,poll_queue=true|false\"", ) .takes_value(true) @@ -299,8 +292,8 @@ fn start_vmm(cmd_arguments: ArgMatches) { .expect("Missing argument: api-socket"); println!( - "Cloud Hypervisor Guest\n\tAPI server: {}\n\tvCPUs: {}\n\tMemory: {} MB\ - \n\tKernel: {:?}\n\tKernel cmdline: {}\n\tDisk(s): {:?}", + "Cloud Hypervisor Guest\n\tAPI server: {}\n\tvCPUs: {}\n\tMemory: {} MB\n\tKernel: \ + {:?}\n\tKernel cmdline: {}\n\tDisk(s): {:?}", api_socket_path, vm_config.cpus.boot_vcpus, vm_config.memory.size >> 20,