1919#include " project_env/project_env.h"
2020#include " data/data.h"
2121#include " organization/organization.h"
22+ #include " whoami/whoami.h"
2223
2324using namespace std ;
2425
@@ -58,8 +59,9 @@ struct command fetch_cmd = {"fetch", {"--table"}, true, true};
5859struct command kill_deployment_cmd = {" kill" , {" --deployments" , " --job_ids" }, true , true };
5960struct command remote_cmd = {" remote" , {}, true , true };
6061struct command organizations_cmd = {" orgs" , {" --set-default" }, true , true };
62+ struct command whoami_cmd = {" whoami" , {}, false , true };
6163
62- struct command command_list[11 ] = {
64+ struct command command_list[12 ] = {
6365 setup_cmd,
6466 init_cmd,
6567 auth_cmd,
@@ -70,7 +72,8 @@ struct command command_list[11] = {
7072 fetch_cmd,
7173 kill_deployment_cmd,
7274 remote_cmd,
73- organizations_cmd
75+ organizations_cmd,
76+ whoami_cmd
7477};
7578
7679
@@ -374,12 +377,15 @@ void organizations(int argc, char **argv, int cmd_index) {
374377 console::error (" You must supply an organization name and the --set-default argument to switch default organizations." );
375378 break ;
376379 case 2 :
377- console::info (" All your organizations:\n " );
378380 Organization::list ();
379381 break ;
380382 }
381383}
382384
385+ void whoami () {
386+ Whoami::information ();
387+ }
388+
383389
384390int Dispatch::dispatch (int argc, char **argv, int cmd_index) {
385391 FunctionCaller disp;
@@ -395,6 +401,7 @@ int Dispatch::dispatch(int argc, char **argv, int cmd_index) {
395401 disp.insert (" kill" , kill_deployment);
396402 disp.insert (" remote" , remote);
397403 disp.insert (" orgs" , organizations);
404+ disp.insert (" whoami" , whoami);
398405
399406 if (command_list[cmd_index].needs_auth ) {
400407 VERIFY_AUTH ();
0 commit comments