1 // Copyright 2019 Intel Corporation. All Rights Reserved. 2 // 3 // Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 // 5 // Portions Copyright 2017 The Chromium OS Authors. All rights reserved. 6 // 7 // SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause) 8 9 use clap::{Arg, Command}; 10 use vhost_user_net::start_net_backend; 11 12 fn main() { 13 env_logger::init(); 14 15 let cmd_arguments = Command::new("vhost-user-net backend") 16 .version(env!("CARGO_PKG_VERSION")) 17 .author(env!("CARGO_PKG_AUTHORS")) 18 .about("Launch a vhost-user-net backend.") 19 .arg( 20 Arg::new("net-backend") 21 .long("net-backend") 22 .help(vhost_user_net::SYNTAX) 23 .num_args(1) 24 .required(true), 25 ) 26 .get_matches(); 27 28 let backend_command = cmd_arguments.get_one::<String>("net-backend").unwrap(); 29 start_net_backend(backend_command); 30 } 31