From 2327a7a17bc7dd7b23f44611c62aded330c4bb0c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Jun 2021 19:03:59 +0100 Subject: [PATCH] otter cli: Change defaulting order of server and account We're going to need the server to decide the account. Signed-off-by: Ian Jackson --- src/bin/otter.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 1a2e181d..74c7b985 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -497,6 +497,13 @@ fn main() { Ok(spec_dir) })?; + let server = server.map(Ok::<_,APE>).unwrap_or_else(||{ + Ok(SL::Socket( + config.clone()?.0 + .command_socket.clone() + )) + })?; + let account: AccountName = account.map(Ok::<_,APE>).unwrap_or_else(||{ let user = env::var("USER").map_err(|e| ArgumentParseError( format!("default account needs USER env var: {}", &e) @@ -507,13 +514,6 @@ fn main() { }) })?; - let server = server.map(Ok::<_,APE>).unwrap_or_else(||{ - Ok(SL::Socket( - config.clone()?.0 - .command_socket.clone() - )) - })?; - let sc = inventory::iter::.into_iter() .filter(|Subcommand{verb:found,..}| found == &subcommand) .next() -- 2.30.2