xref: /cloud-hypervisor/vhost_user_net/src/main.rs (revision 6f8bd27cf7629733582d930519e98d19e90afb16)
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::{Arg, Command};
13 use vhost_user_net::start_net_backend;
14 
15 fn main() {
16     env_logger::init();
17 
18     let cmd_arguments = Command::new("vhost-user-net backend")
19         .version(crate_version!())
20         .author(crate_authors!())
21         .about("Launch a vhost-user-net backend.")
22         .arg(
23             Arg::new("net-backend")
24                 .long("net-backend")
25                 .help(vhost_user_net::SYNTAX)
26                 .num_args(1)
27                 .required(true),
28         )
29         .get_matches();
30 
31     let backend_command = cmd_arguments.get_one::<String>("net-backend").unwrap();
32     start_net_backend(backend_command);
33 }
34