-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4968 from wasmerio/cli-auth-command
CLI: Introduce new `auth` subcommand
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
mod login; | ||
mod logout; | ||
mod whoami; | ||
|
||
pub use login::*; | ||
pub use logout::*; | ||
pub use whoami::*; | ||
|
||
use super::AsyncCliCommand; | ||
|
||
/// Manage your . | ||
#[derive(clap::Subcommand, Debug)] | ||
pub enum CmdAuth { | ||
Login(login::Login), | ||
Logout(logout::Logout), | ||
Whoami(whoami::Whoami), | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl AsyncCliCommand for CmdAuth { | ||
type Output = (); | ||
|
||
async fn run_async(self) -> Result<Self::Output, anyhow::Error> { | ||
match self { | ||
CmdAuth::Login(l) => l.run_async().await, | ||
CmdAuth::Logout(l) => l.run_async().await, | ||
CmdAuth::Whoami(w) => w.run_async().await, | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters