|
|
|
@ -102,10 +102,10 @@ pub fn parser() -> Command<'static> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn get(args: &ArgMatches, global_args: &ArgMatches) -> Result<(), CliError> {
|
|
|
|
|
pub fn get(args: &ArgMatches) -> Result<(), CliError> {
|
|
|
|
|
let name = args.get_one("name").cloned();
|
|
|
|
|
let base = *args.get_one("base").unwrap_or(&false);
|
|
|
|
|
let addr = global_args.get_one("server_addr").cloned();
|
|
|
|
|
let addr = args.get_one("server_addr").cloned();
|
|
|
|
|
|
|
|
|
|
let output = match make_request(addr, &Request::GetAwsCredentials { name, base })? {
|
|
|
|
|
Response::AwsBase(creds) => serde_json::to_string(&creds).unwrap(),
|
|
|
|
@ -117,10 +117,10 @@ pub fn get(args: &ArgMatches, global_args: &ArgMatches) -> Result<(), CliError>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn exec(args: &ArgMatches, global_args: &ArgMatches) -> Result<(), CliError> {
|
|
|
|
|
pub fn exec(args: &ArgMatches) -> Result<(), CliError> {
|
|
|
|
|
let name = args.get_one("name").cloned();
|
|
|
|
|
let base = *args.get_one("base").unwrap_or(&false);
|
|
|
|
|
let addr = global_args.get_one("server_addr").cloned();
|
|
|
|
|
let addr = args.get_one("server_addr").cloned();
|
|
|
|
|
let mut cmd_line = args.get_many("command")
|
|
|
|
|
.ok_or(ExecError::NoCommand)?;
|
|
|
|
|
|
|
|
|
@ -172,8 +172,8 @@ pub fn exec(args: &ArgMatches, global_args: &ArgMatches) -> Result<(), CliError>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn invoke_shortcut(args: &ArgMatches, global_args: &ArgMatches) -> Result<(), CliError> {
|
|
|
|
|
let addr = global_args.get_one("server_addr").cloned();
|
|
|
|
|
pub fn invoke_shortcut(args: &ArgMatches) -> Result<(), CliError> {
|
|
|
|
|
let addr = args.get_one("server_addr").cloned();
|
|
|
|
|
let action = match args.get_one::<String>("action").map(|s| s.as_str()) {
|
|
|
|
|
Some("show_window") => ShortcutAction::ShowWindow,
|
|
|
|
|
Some("launch_terminal") => ShortcutAction::LaunchTerminal,
|
|
|
|
|