pub fn parse_cmdline() -> TomlWsssConfig {
    let mut port: Option<u32> = None;
    let mut ws_port: Option<u32> = None;
    let mut bind_address: Option<String> = None;

    {
      let mut ap = ArgumentParser::new();
      ap.set_description("Provide access to serial ports over JSON Websockets");
      ap.refer(&mut port)
        .add_option(&["-p", "--http_port"], StoreOption, "Http Port");
      ap.refer(&mut ws_port)
        .add_option(&["-w", "--ws_port"], StoreOption, "Websocket Port");
      ap.refer(&mut bind_address).add_option(
        &["-a", "--bind_address"],
        StoreOption,
        "Bind Address",
      );
      ap.parse_args_or_exit();
    }

    TomlWsssConfig {
      http_port: port,
      ws_port: ws_port,
      bind_address: bind_address,
    }
  }
/// Parse the command line returning a config with
/// defaults overridden by commandline values.
Parse the command line returning a config with
defaults overridden by commandline values.
Parse the command line returning a config with defaults overridden by commandline values .
pub fn parse_cmdline() -> TomlWsssConfig {
    let mut port: Option<u32> = None;
    let mut ws_port: Option<u32> = None;
    let mut bind_address: Option<String> = None;
    {
      let mut ap = ArgumentParser::new();
      ap.set_description("Provide access to serial ports over JSON Websockets");
      ap.refer(&mut port)
        .add_option(&["-p", "--http_port"], StoreOption, "Http Port");
      ap.refer(&mut ws_port)
        .add_option(&["-w", "--ws_port"], StoreOption, "Websocket Port");
      ap.refer(&mut bind_address).add_option(
        &["-a", "--bind_address"],
        StoreOption,
        "Bind Address",
      );
      ap.parse_args_or_exit();
    }
    TomlWsssConfig {
      http_port: port,
      ws_port: ws_port,
      bind_address: bind_address,
    }
  }
pub fn parse_cmdline ( ) -> TomlWsssConfig { let mut port : Option < u32 > = None ; let mut ws_port : Option < u32 > = None ; let mut bind_address : Option < String > = None ; { let mut ap = ArgumentParser :: new ( ) ; ap . set_description ( " " ) ; ap . refer ( & mut port ) . add_option ( & [ " " , " " ] , StoreOption , " " ) ; ap . refer ( & mut ws_port ) . add_option ( & [ " " , " " ] , StoreOption , " " ) ; ap . refer ( & mut bind_address ) . add_option ( & [ " " , " " ] , StoreOption , " " , ) ; ap . parse_args_or_exit ( ) ; } TomlWsssConfig { http_port : port , ws_port : ws_port , bind_address : bind_address , } }
Parse the command line returning a config with
defaults overridden by commandline values.
Parse the command line returning a config with defaults overridden by commandline values .