514bfe645a40363cb4cd6526b1c09c8e13d025b2
2 * Copyright (c) 2011 David Goulet <david.goulet@polymtl.ca>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; only version 2
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include <common/error.h>
31 * Return allocated string with the session name found in the config
34 char *get_session_name(void)
36 char *path
, *session_name
= NULL
;
38 /* Get path to config file */
39 path
= config_get_default_path();
44 /* Get session name from config */
45 session_name
= config_read_session_name(path
);
46 if (session_name
== NULL
) {
50 DBG2("Config file path found: %s", path
);
51 DBG("Session name found: %s", session_name
);
62 * Prints a simple list of the options available to a command. This is intended
63 * to be easily parsed for bash completion.
65 void list_cmd_options(FILE *ofp
, struct poptOption
*options
)
68 struct poptOption
*option
= NULL
;
70 for (i
= 0; options
[i
].longName
!= NULL
; i
++) {
73 fprintf(ofp
, "--%s\n", option
->longName
);
75 if (isprint(option
->shortName
)) {
76 fprintf(ofp
, "-%c\n", option
->shortName
);
This page took 0.033184 seconds and 5 git commands to generate.