2 * Copyright (C) 2015 Philippe Proulx <pproulx@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
9 #include "../command.hpp"
10 #include "../utils.hpp"
18 #include <sys/types.h>
21 #ifdef LTTNG_EMBED_HELP
22 static const char help_msg
[] =
23 #include <lttng-status.1.h>
32 static struct poptOption long_options
[] = {
33 /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
34 { "help", 'h', POPT_ARG_NONE
, nullptr, OPT_HELP
, nullptr, nullptr },
35 { "list-options", 0, POPT_ARG_NONE
, nullptr, OPT_LIST_OPTIONS
, nullptr, nullptr },
36 { nullptr, 0, 0, nullptr, 0, nullptr, nullptr }
42 int ret
= CMD_SUCCESS
;
43 char *session_name
= nullptr;
45 session_name
= get_session_name();
52 argv
[1] = session_name
;
53 ret
= cmd_list(2, argv
);
60 * The 'status <options>' first level command
62 int cmd_status(int argc
, const char **argv
)
64 int opt
, ret
= CMD_SUCCESS
;
65 static poptContext pc
;
67 pc
= poptGetContext(nullptr, argc
, argv
, long_options
, 0);
68 poptReadDefaultConfig(pc
, 0);
70 while ((opt
= poptGetNextOpt(pc
)) != -1) {
75 case OPT_LIST_OPTIONS
:
76 list_cmd_options(stdout
, long_options
);
84 if (poptPeekArg(pc
) != nullptr) {
85 ERR("This command does not accept positional arguments.\n");
This page took 0.031314 seconds and 4 git commands to generate.