2 * Copyright (C) 2015 Philippe Proulx <pproulx@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
14 #include <sys/types.h>
17 #include "../command.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
, NULL
, OPT_HELP
, NULL
, NULL
},
35 {"list-options", 0, POPT_ARG_NONE
, NULL
, OPT_LIST_OPTIONS
, NULL
, NULL
},
39 static int status(void)
42 int ret
= CMD_SUCCESS
;
43 char *session_name
= NULL
;
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(NULL
, 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
) != NULL
) {
85 ERR("This command does not accept positional arguments.\n");
This page took 0.033533 seconds and 4 git commands to generate.