1
1
//! Show short information about an Edge app.
2
2
3
3
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 } ;
8
5
9
6
/// Show short information about an Edge app.
10
7
///
@@ -13,9 +10,6 @@ use crate::{
13
10
pub struct CmdAppInfo {
14
11
#[ clap( flatten) ]
15
12
api : ApiOpts ,
16
- #[ clap( flatten) ]
17
- fmt : ItemFormatOpts ,
18
-
19
13
#[ clap( flatten) ]
20
14
ident : AppIdentOpts ,
21
15
}
@@ -25,22 +19,19 @@ impl AsyncCliCommand for CmdAppInfo {
25
19
type Output = ( ) ;
26
20
27
21
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 ?;
34
24
35
25
let app_url = app. url ;
36
26
let versioned_url = app. active_version . url ;
37
27
let dashboard_url = app. admin_url ;
38
28
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) ;
44
35
45
36
Ok ( ( ) )
46
37
}
0 commit comments