Skip to content

Commit

Permalink
fix(cli): Fix output of "app info" command
Browse files Browse the repository at this point in the history
  • Loading branch information
theduke committed Feb 21, 2024
1 parent 76fbab3 commit 6770f57
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions lib/cli/src/commands/app/info.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! Show short information about an Edge app.
use super::util::AppIdentOpts;
use crate::{
commands::{app::get::CmdAppGet, AsyncCliCommand},
opts::{ApiOpts, ItemFormatOpts},
};
use crate::{commands::AsyncCliCommand, opts::ApiOpts};

/// Show short information about an Edge app.
///
Expand All @@ -13,9 +10,6 @@ use crate::{
pub struct CmdAppInfo {
#[clap(flatten)]
api: ApiOpts,
#[clap(flatten)]
fmt: ItemFormatOpts,

#[clap(flatten)]
ident: AppIdentOpts,
}
Expand All @@ -25,19 +19,16 @@ impl AsyncCliCommand for CmdAppInfo {
type Output = ();

async fn run_async(self) -> Result<(), anyhow::Error> {
let cmd_app_get = CmdAppGet {
api: self.api,
fmt: self.fmt,
ident: self.ident,
};
let app = cmd_app_get.run_async().await?;
let client = self.api.client()?;
let (_ident, app) = self.ident.load_app(&client).await?;

let app_url = app.url;
let versioned_url = app.active_version.url;
let dashboard_url = app.admin_url;

eprintln!(" App Info ");
eprintln!("> App Name: {}", app.name);
eprintln!("> Namespace: {}", app.owner.global_name);
eprintln!("> App URL: {}", app_url);
eprintln!("> Versioned URL: {}", versioned_url);
eprintln!("> Admin dashboard: {}", dashboard_url);
Expand Down

0 comments on commit 6770f57

Please sign in to comment.