From 9d5894a43e3b4dcc4c3b2756b289aba51eef6c63 Mon Sep 17 00:00:00 2001 From: kx Date: Fri, 2 Oct 2026 08:45:51 +0300 Subject: Move per-user configuration to /home/kx/.mcpu/etc/mcpu-cpp.conf and add --sys-root=PATH --- src/mcpp-options.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/mcpp-options.c') diff --git a/src/mcpp-options.c b/src/mcpp-options.c index 62fafc6..8d0d8cd 100644 --- a/src/mcpp-options.c +++ b/src/mcpp-options.c @@ -139,6 +139,24 @@ mcpp_handle_options( mcpp_options *opts, int argc, char **argv ) if( strcmp(arg, "--help") == 0 ) opts->help = 1; else if( strcmp(arg, "--version") == 0 ) opts->version = 1; else if( strcmp(arg, "--no-config") == 0 ) opts->no_config = 1; + else if( strncmp(arg, "--sys-root=", 11) == 0 ) + { + if( arg[11] == 0 ) + { + fprintf( stderr, "%s: empty path in '--sys-root='\n", + opts->progname ); + return( -1 ); + } + opts->sys_root = arg + 11; + opts->no_config = 1; + } + else if( strcmp(arg, "--sys-root") == 0 ) + { + value = option_argument(opts, argc, argv, &i, NULL, arg); + if( value == NULL || *value == 0 ) return( -1 ); + opts->sys_root = value; + opts->no_config = 1; + } else if( strcmp(arg, "--config-file") == 0 ) { value = option_argument(opts, argc, argv, &i, NULL, arg); -- cgit v1.2.3