cloud-hypervisor/vhost_user_block/src/main.rs
Bo Chen 0ee8ead53d ch-remote, main, vhost_user: Fix deprecated APIs for clap v3.1.0
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 01:56:54 +00:00

37 lines
1.1 KiB
Rust

// Copyright 2019 Red Hat, Inc. All Rights Reserved.
//
// Portions Copyright 2019 Intel Corporation. All Rights Reserved.
//
// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
//
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
#[macro_use(crate_version, crate_authors)]
extern crate clap;
extern crate vhost_user_block;
use clap::{Arg, Command};
use vhost_user_block::start_block_backend;
fn main() {
env_logger::init();
let cmd_arguments = Command::new("vhost-user-blk backend")
.version(crate_version!())
.author(crate_authors!())
.about("Launch a vhost-user-blk backend.")
.arg(
Arg::new("block-backend")
.long("block-backend")
.help(vhost_user_block::SYNTAX)
.takes_value(true)
.required(true),
)
.get_matches();
let backend_command = cmd_arguments.value_of("block-backend").unwrap();
start_block_backend(backend_command);
}