Skip to content

Commit 2643389

Browse files
committed
fix(cli): Fix output of "app info" command
1 parent 7869644 commit 2643389

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

lib/cli/src/commands/app/info.rs

+9-18
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
//! Show short information about an Edge app.
22
33
use super::util::AppIdentOpts;
4-
use crate::{
5-
commands::{app::get::CmdAppGet, AsyncCliCommand},
6-
opts::{ApiOpts, ItemFormatOpts},
7-
};
4+
use crate::{commands::AsyncCliCommand, opts::ApiOpts};
85

96
/// Show short information about an Edge app.
107
///
@@ -13,9 +10,6 @@ use crate::{
1310
pub struct CmdAppInfo {
1411
#[clap(flatten)]
1512
api: ApiOpts,
16-
#[clap(flatten)]
17-
fmt: ItemFormatOpts,
18-
1913
#[clap(flatten)]
2014
ident: AppIdentOpts,
2115
}
@@ -25,22 +19,19 @@ impl AsyncCliCommand for CmdAppInfo {
2519
type Output = ();
2620

2721
async fn run_async(self) -> Result<(), anyhow::Error> {
28-
let cmd_app_get = CmdAppGet {
29-
api: self.api,
30-
fmt: self.fmt,
31-
ident: self.ident,
32-
};
33-
let app = cmd_app_get.run_async().await?;
22+
let client = self.api.client()?;
23+
let (_ident, app) = self.ident.load_app(&client).await?;
3424

3525
let app_url = app.url;
3626
let versioned_url = app.active_version.url;
3727
let dashboard_url = app.admin_url;
3828

39-
eprintln!(" App Info ");
40-
eprintln!("> App Name: {}", app.name);
41-
eprintln!("> App URL: {}", app_url);
42-
eprintln!("> Versioned URL: {}", versioned_url);
43-
eprintln!("> Admin dashboard: {}", dashboard_url);
29+
println!(" App Info ");
30+
println!("> App Name: {}", app.name);
31+
println!("> Namespace: {}", app.owner.global_name);
32+
println!("> App URL: {}", app_url);
33+
println!("> Versioned URL: {}", versioned_url);
34+
println!("> Admin dashboard: {}", dashboard_url);
4435

4536
Ok(())
4637
}

0 commit comments

Comments
 (0)