access: Option<AccessOpt>,
socket_path: String,
verbose: i32,
+ superuser: bool,
}
impl MainOpts {
access: Option<AccessOpt>,
verbose: i32,
config_filename: Option<String>,
+ superuser: bool,
subcommand: String,
subargs: Vec<String>,
};
"set verbosity to error messages only");
verbose.add_option(&["-v","--verbose"], IncrBy(1),
"increase verbosity (default is short progress messages)");
+
+ ap.refer(&mut rma.superuser)
+ .add_option(&["--super"], StoreTrue,
+ "enable game server superuser access");
+
ap
}, &|RawMainArgs {
account, gaccount, nick, timezone,
- access, socket_path, verbose, config_filename,
+ access, socket_path, verbose, config_filename, superuser,
subcommand, subargs,
}|{
let account : AccountName = account.map(Ok::<_,APE>).unwrap_or_else(||{
timezone,
socket_path,
verbose,
+ superuser,
}))
}, Some(&|w|{
writeln!(w, "\nSubcommands:")?;
.with_context(||ma.socket_path.clone()).context("connect to server")?;
let chan = MgmtChannel::new(unix)?;
let mut chan = Conn { chan };
- chan.cmd(&MgmtCommand::SelectAccount(ma.account.clone()))?;
+ if ma.superuser {
+ chan.cmd(&MC::SetSuperuser(true))?;
+ }
+ chan.cmd(&MC::SelectAccount(ma.account.clone()))?;
chan
}