Compare commits
	
		
			1 Commits
		
	
	
		
			20faee0a37
			...
			cfa338559e
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| cfa338559e | 
| @ -148,7 +148,8 @@ fn clap_cmd() -> Command { | ||||
|                     ) | ||||
|                     .arg( | ||||
|                         Arg::new("port") | ||||
|                         .long("port") | ||||
|                         .short('p') | ||||
|                         .long("expose-port") | ||||
|                         .value_parser(clap::value_parser!(u32).range(0..65535)) | ||||
|                         .action(clap::ArgAction::Append) | ||||
|                         .help("Application exposing port") | ||||
| @ -394,6 +395,17 @@ fn clap_cmd() -> Command { | ||||
|                     .long("public-ip") | ||||
|                     .help("get a public IPv4 address for this VM") | ||||
|                     .action(clap::ArgAction::SetTrue) | ||||
|                     .conflicts_with("port") | ||||
|                 ) | ||||
|                 .arg( | ||||
|                     Arg::new("port") | ||||
|                     .short('p') | ||||
|                     .long("expose-port") | ||||
|                     .value_parser(clap::value_parser!(u32).range(0..65535)) | ||||
|                     .action(clap::ArgAction::Append) | ||||
|                     .help("vm exposing port") | ||||
|                     .long_help("Port to expose on the vm which mapped into the host's public IP's port") | ||||
|                     .conflicts_with("public-ip") | ||||
|                 ) | ||||
|             ) | ||||
|             .subcommand(Command::new("inspect").about("list all available information about a VM") | ||||
|  | ||||
| @ -63,8 +63,13 @@ fn handle_vm_deploy(matches: &ArgMatches) -> Result<snp::VmSshArgs, Box<dyn Erro | ||||
|     let location = matches.get_one::<String>("location").unwrap().as_str(); | ||||
|     let ipv4: crate::snp::deploy::IPv4Config = match matches.get_one::<bool>("public-ip").unwrap() { | ||||
|         true => crate::snp::deploy::IPv4Config::PublicIPv4, | ||||
|         false => crate::snp::deploy::IPv4Config::PublishPorts(Vec::new()), | ||||
|         false => { | ||||
|             let exposing_port = | ||||
|                 matches.get_many::<u32>("port").unwrap_or_default().cloned().collect::<Vec<_>>(); | ||||
|             crate::snp::deploy::IPv4Config::PublishPorts(exposing_port) | ||||
|         } | ||||
|     }; | ||||
| 
 | ||||
|     let distro = | ||||
|         crate::snp::Distro::from_string(matches.get_one::<String>("distribution").unwrap()); | ||||
|     let vm_config = snp::deploy::Request { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user