Skip to content

Commit

Permalink
add story command
Browse files Browse the repository at this point in the history
  • Loading branch information
arvid220u committed Jun 30, 2022
1 parent 3ce2f53 commit bc3094e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cli/as_cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,20 @@ int main(int argc, char** argv) {
cout << "Successfully changed latency to " << latency << " seconds!"
<< endl;

} else if (command == "story") {
grpc::ClientContext context;
asphrdaemon::GetMyPublicIDRequest request;
asphrdaemon::GetMyPublicIDResponse response;

grpc::Status status = stub->GetMyPublicID(&context, request, &response);

if (!status.ok()) {
cout << "failed to get my public ID: " << status.error_message() << endl;
return 0;
}

cout << "Story: " << response.story() << endl;

} else {
cout << "Unknown command: " << command << endl;
cout << help << endl;
Expand Down

0 comments on commit bc3094e

Please sign in to comment.