2 * Copyright (C) 2015 - Philippe Proulx <pproulx@efficios.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2 only,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <sys/types.h>
27 #include "../command.h"
31 #ifdef LTTNG_EMBED_HELP
32 static const char help_msg
[] =
33 #include <lttng-status.1.h>
42 static struct poptOption long_options
[] = {
43 /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
44 {"help", 'h', POPT_ARG_NONE
, NULL
, OPT_HELP
, NULL
, NULL
},
45 {"list-options", 0, POPT_ARG_NONE
, NULL
, OPT_LIST_OPTIONS
, NULL
, NULL
},
49 static int status(void)
52 int ret
= CMD_SUCCESS
;
53 char *session_name
= NULL
;
55 session_name
= get_session_name();
62 argv
[1] = session_name
;
63 ret
= cmd_list(2, argv
);
70 * The 'status <options>' first level command
72 int cmd_status(int argc
, const char **argv
)
74 int opt
, ret
= CMD_SUCCESS
;
75 static poptContext pc
;
77 pc
= poptGetContext(NULL
, argc
, argv
, long_options
, 0);
78 poptReadDefaultConfig(pc
, 0);
80 while ((opt
= poptGetNextOpt(pc
)) != -1) {
85 case OPT_LIST_OPTIONS
:
86 list_cmd_options(stdout
, long_options
);
94 if (poptPeekArg(pc
) != NULL
) {
95 ERR("This command does not accept positional arguments.\n");
This page took 0.032103 seconds and 5 git commands to generate.