1+ mod pocketic_config_port;
12mod replica_port;
23mod webserver_port;
34use crate :: commands:: info:: { replica_port:: get_replica_port, webserver_port:: get_webserver_port} ;
@@ -10,21 +11,24 @@ use crate::Environment;
1011use anyhow:: { bail, Context } ;
1112use clap:: { Parser , Subcommand } ;
1213use dfx_core:: config:: model:: dfinity:: NetworksConfig ;
14+ use pocketic_config_port:: get_pocketic_config_port;
1315
1416#[ derive( Subcommand , Clone , Debug ) ]
1517enum InfoType {
1618 /// Show the URL of the Candid UI canister
1719 CandidUiUrl ,
1820 /// Show the headers that gets applied to assets in .ic-assets.json5 if "security_policy" is "standard" or "hardened".
1921 SecurityPolicy ,
20- /// Show the port of the local replica
21- ReplicaPort ,
22+ /// Show the port of the local IC API/HTTP gateway
23+ WebserverPort ,
2224 /// Show the revision of the replica shipped with this dfx binary
2325 ReplicaRev ,
24- /// Show the port of the webserver
25- WebserverPort ,
2626 /// Show the path to network configuration file
2727 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 ,
2832}
2933
3034#[ derive( Parser ) ]
@@ -54,6 +58,7 @@ pub fn exec(env: &dyn Environment, opts: InfoOpts) -> DfxResult {
5458 ic_asset:: security_policy:: SecurityPolicy :: Standard . to_json5_str ( )
5559 }
5660 InfoType :: ReplicaPort => get_replica_port ( env) ?,
61+ InfoType :: PocketicConfigPort => get_pocketic_config_port ( env) ?,
5762 InfoType :: ReplicaRev => info:: replica_rev ( ) . to_string ( ) ,
5863 InfoType :: WebserverPort => get_webserver_port ( env) ?,
5964 InfoType :: NetworksJsonPath => NetworksConfig :: new ( ) ?
0 commit comments