Skip to content

Commit b2067e1

Browse files
committed
Restore help interception functionality
1 parent d52e869 commit b2067e1

File tree

1 file changed

+10
-1
lines changed
  • base/cvd/cuttlefish/host/commands/cvd

1 file changed

+10
-1
lines changed

base/cvd/cuttlefish/host/commands/cvd/cvd.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
#include "cuttlefish/host/commands/cvd/legacy/cvd_server.pb.h"
2525
#include "host/commands/cvd/cli/command_request.h"
2626
#include "host/commands/cvd/cli/frontline_parser.h"
27+
#include "host/commands/cvd/cli/request_context.h"
28+
#include "host/commands/cvd/cli/utils.h"
2729
#include "host/commands/cvd/instances/instance_lock.h"
2830
#include "host/commands/cvd/instances/instance_manager.h"
29-
#include "host/commands/cvd/cli/request_context.h"
3031

3132
namespace cuttlefish {
3233

@@ -69,6 +70,14 @@ Result<cvd::Response> Cvd::HandleCommand(
6970

7071
RequestContext context(instance_lockfile_manager_, instance_manager_);
7172
auto handler = CF_EXPECT(context.Handler(request));
73+
if (handler->ShouldInterceptHelp()) {
74+
auto invocation_args = ParseInvocation(request).arguments;
75+
if (CF_EXPECT(IsHelpSubcmd(invocation_args))) {
76+
std::cout << CF_EXPECT(handler->DetailedHelp(invocation_args))
77+
<< std::endl;
78+
return SuccessResponse();
79+
}
80+
}
7281
return handler->Handle(request);
7382
}
7483

0 commit comments

Comments
 (0)