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 #[macro_use(crate_version, crate_authors)] 10 extern crate clap; 11 12 use clap::{App, Arg}; 13 use vhost_user_net::start_net_backend; 14 15 fn main() { 16 let cmd_arguments = App::new("vhost-user-net backend") 17 .version(crate_version!()) 18 .author(crate_authors!()) 19 .about("Launch a vhost-user-net backend.") 20 .arg( 21 Arg::with_name("net-backend") 22 .long("net-backend") 23 .help(vhost_user_net::SYNTAX) 24 .takes_value(true) 25 .min_values(1), 26 ) 27 .get_matches(); 28 29 let backend_command = cmd_arguments.value_of("net-backend").unwrap(); 30 start_net_backend(backend_command); 31 } 32