cli: make config cli args functions return a status enum
[babeltrace.git] / src / cli / babeltrace2-cfg-cli-args.h
CommitLineData
ebba3338 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
ebba3338 3 *
0235b0db 4 * Copyright 2016-2017 Philippe Proulx <pproulx@efficios.com>
ebba3338
PP
5 */
6
0235b0db
MJ
7#ifndef CLI_BABELTRACE_CFG_CLI_ARGS_H
8#define CLI_BABELTRACE_CFG_CLI_ARGS_H
9
c4f23e30 10#include <stdbool.h>
ebba3338
PP
11#include <stdlib.h>
12#include <stdint.h>
3fadfbc0 13#include <babeltrace2/value.h>
578e048b
MJ
14#include "lib/object.h"
15#include "compat/compiler.h"
43c59509 16#include <babeltrace2/graph/component.h>
ebba3338 17#include <glib.h>
ebba3338 18
ec2c5e50 19#include "babeltrace2-cfg.h"
ebba3338 20
353c2524
SM
21/*
22 * Return value of functions that create a bt_config from CLI args and return
23 * it through an out parameter.
24 */
25enum bt_config_cli_args_status
26{
27 /*
28 * Config was successfully created and returned through the out
29 * parameter.
30 */
31 BT_CONFIG_CLI_ARGS_STATUS_OK = 0,
32
33 /*
34 * Config could not be created due to an error. The out parameter is
35 * left unchanged.
36 */
37 BT_CONFIG_CLI_ARGS_STATUS_ERROR = -1,
38
39 /*
40 * The arguments caused the function to print some information (help,
41 * version, etc), not config was created. The out parameter is left
42 * unchanged.
43 */
44 BT_CONFIG_CLI_ARGS_STATUS_INFO_ONLY = 1,
45};
46
47enum bt_config_cli_args_status bt_config_cli_args_create(int argc,
48 const char *argv[],
49 struct bt_config **cfg, bool force_omit_system_plugin_path,
9a16feea 50 bool force_omit_home_plugin_path,
3dae1685
SM
51 const bt_value *initial_plugin_paths,
52 const bt_interrupter *interrupter);
ebba3338 53
9009cc24 54#endif /* CLI_BABELTRACE_CFG_CLI_ARGS_H */
This page took 0.064414 seconds and 4 git commands to generate.