project(
'labwc',
'c',
+ version: '0.1.0',
license: 'GPL-2',
default_options: [
'c_std=c11',
language: 'c',
)
+version='"@0@"'.format(meson.project_version())
+add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
+
wlroots_proj = subproject(
'wlroots',
default_options: ['examples=false'],
struct rcxml rc = { 0 };
static const char labwc_usage[] =
- "Usage: labwc [-h] [-s <startup-command>] [-c <config-file>] [-v]\n";
+ "Usage: labwc [-h] [-s <command>] [-c <config-file>] [-d] [-V] [-v]\n";
static void
usage(void)
{
char *startup_cmd = NULL;
char *config_file = NULL;
- enum verbosity {
- LAB_VERBOSITY_ERROR = 0,
- LAB_VERBOSITY_INFO,
- LAB_VERBOSITY_DEBUG,
- } verbosity = LAB_VERBOSITY_ERROR;
+ enum wlr_log_importance verbosity = WLR_ERROR;
int c;
- while ((c = getopt(argc, argv, "c:s:hv")) != -1) {
+ while ((c = getopt(argc, argv, "c:dhs:vV")) != -1) {
switch (c) {
case 'c':
config_file = optarg;
break;
+ case 'd':
+ verbosity = WLR_DEBUG;
+ break;
case 's':
startup_cmd = optarg;
break;
case 'v':
- ++verbosity;
+ printf("labwc " LABWC_VERSION "\n");
+ exit(0);
+ case 'V':
+ verbosity = WLR_INFO;
break;
case 'h':
default:
usage();
}
- switch (verbosity) {
- case LAB_VERBOSITY_ERROR:
- wlr_log_init(WLR_ERROR, NULL);
- break;
- case LAB_VERBOSITY_INFO:
- wlr_log_init(WLR_INFO, NULL);
- break;
- case LAB_VERBOSITY_DEBUG:
- default:
- wlr_log_init(WLR_DEBUG, NULL);
- break;
- }
+ wlr_log_init(verbosity, NULL);
session_environment_init();
rcxml_read(config_file);