#[derive(Debug)]
struct MainOpts {
account: AccountName,
- gaccount: AccountName,
nick: Option<String>,
timezone: Option<String>,
access: Option<AccessOpt>,
match table_name.strip_prefix(":") {
Some(rest) => {
InstanceName {
- account: self.gaccount.clone(),
+ account: self.account.clone(),
game: rest.into(),
}
}
#[derive(Default,Debug)]
struct RawMainArgs {
account: Option<AccountName>,
- gaccount: Option<AccountName>,
socket_path: Option<String>,
nick: Option<String>,
timezone: Option<String>,
StoreConst(Some(PlayerAccessUnset.into())),
"do not show game access info (for testing only)");
- let mut gaccount = ap.refer(&mut rma.gaccount);
- gaccount.metavar("GAME-ACCOUNT").add_option(&["--game-name-account"],
- StoreOption,
- "manipulate game in GAME-ACCOUNT rather than ACCOUNT");
ap.refer(&mut rma.socket_path)
.add_option(&["--socket"], StoreOption,
"specify server socket path");
ap
}, &|RawMainArgs {
- account, gaccount, nick, timezone,
+ account, nick, timezone,
access, socket_path, verbose, config_filename, superuser,
subcommand, subargs,
}|{
subaccount: "".into(),
})
})?;
- let gaccount = gaccount.unwrap_or_else(|| account.clone());
let config_filename = config_filename.or_else(||{
match match env::current_exe()
.map(|p| p.to_str().map(|s| s.to_string()))
})?;
Ok((subcommand, subargs, MainOpts {
account,
- gaccount,
access,
nick,
timezone,