1
+ mod pocketic_config_port;
1
2
mod replica_port;
2
3
mod webserver_port;
3
4
use crate :: commands:: info:: { replica_port:: get_replica_port, webserver_port:: get_webserver_port} ;
@@ -10,21 +11,24 @@ use crate::Environment;
10
11
use anyhow:: { bail, Context } ;
11
12
use clap:: { Parser , Subcommand } ;
12
13
use dfx_core:: config:: model:: dfinity:: NetworksConfig ;
14
+ use pocketic_config_port:: get_pocketic_config_port;
13
15
14
16
#[ derive( Subcommand , Clone , Debug ) ]
15
17
enum InfoType {
16
18
/// Show the URL of the Candid UI canister
17
19
CandidUiUrl ,
18
20
/// Show the headers that gets applied to assets in .ic-assets.json5 if "security_policy" is "standard" or "hardened".
19
21
SecurityPolicy ,
20
- /// Show the port of the local replica
21
- ReplicaPort ,
22
+ /// Show the port of the local IC API/HTTP gateway
23
+ WebserverPort ,
22
24
/// Show the revision of the replica shipped with this dfx binary
23
25
ReplicaRev ,
24
- /// Show the port of the webserver
25
- WebserverPort ,
26
26
/// Show the path to network configuration file
27
27
NetworksJsonPath ,
28
+ /// Show the port the replica is using, if it is running
29
+ ReplicaPort ,
30
+ /// Show the port that PocketIC is using, if it is running
31
+ PocketicConfigPort ,
28
32
}
29
33
30
34
#[ derive( Parser ) ]
@@ -54,6 +58,7 @@ pub fn exec(env: &dyn Environment, opts: InfoOpts) -> DfxResult {
54
58
ic_asset:: security_policy:: SecurityPolicy :: Standard . to_json5_str ( )
55
59
}
56
60
InfoType :: ReplicaPort => get_replica_port ( env) ?,
61
+ InfoType :: PocketicConfigPort => get_pocketic_config_port ( env) ?,
57
62
InfoType :: ReplicaRev => info:: replica_rev ( ) . to_string ( ) ,
58
63
InfoType :: WebserverPort => get_webserver_port ( env) ?,
59
64
InfoType :: NetworksJsonPath => NetworksConfig :: new ( ) ?
0 commit comments