summaryrefslogtreecommitdiff
path: root/lsu.h
blob: 1c2ba1cdf482b8cb8070a0828b95a2afce434f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: GPL-2.0 */

/** \file lsu.h Lopsub Utilities, enums and public functions. */
int lsu_com_help(bool long_help, const struct lls_parse_result *lpr,
		const struct lls_suite *suite,
		const char *(*aux_info_cb)(unsigned cmd_num, bool verbose),
		char **result, unsigned *num_chars);

/** Flags for \ref lsu_merge_config_file_options(). */
enum lsu_merge_cf_flags {
	/**
	 * Whether the options specified in the configuration file should
	 * override the currently effective options. At application startup
	 * this is usually unset so that command line options take precedence
	 * over config file options. However, if the application supports
	 * re-reading the configuration, it can make sense to enable this flag.
	 */
	MCF_OVERRIDE = 1,
	/**
	 * After the two lopsub parse results have been merged, the merged
	 * parse result usually becomes the effective configuration and the
	 * parse result which corresponds to the former effective options is no
	 * longer needed. Therefore \ref lsu_merge_config_file_options() frees
	 * this former parse result by default. This flag instructs the
	 * function to keep it. This is mostly useful if the application
	 * supports re-reading the config file so that the parse result which
	 * corresponds to the command line options is kept for future calls to
	 * \ref lsu_merge_config_file_options().
	 */
	MCF_DONT_FREE = 2,
};

int lsu_merge_config_file_options(const char *path, const char *dflt,
		struct lls_parse_result **lpr, const struct lls_command *cmd,
		const struct lls_suite *suite, unsigned flags);