-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3316: Implement wasmer whoami r=Michael-F-Bryan a=fschutt Note: has to be rebased on the `wasmer login` branch, otherwise the integration test won't work Co-authored-by: Felix Schütt <felix@wasmer.io> Co-authored-by: Felix Schütt <12084016+fschutt@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
136 additions
and
12 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
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use clap::Parser; | ||
|
||
#[derive(Debug, Parser)] | ||
/// The options for the `wasmer whoami` subcommand | ||
pub struct Whoami { | ||
/// Which registry to check the logged in username for | ||
#[clap(long, name = "registry")] | ||
pub registry: Option<String>, | ||
} | ||
|
||
impl Whoami { | ||
/// Execute `wasmer whoami` | ||
pub fn execute(&self) -> Result<(), anyhow::Error> { | ||
let (registry, username) = wasmer_registry::whoami(self.registry.as_deref())?; | ||
println!("logged into registry {registry:?} as user {username:?}"); | ||
Ok(()) | ||
} | ||
} |
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
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
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
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