aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-02-12 11:18:43 +0200
committerSergey Poznyakoff <gray@gnu.org>2021-02-12 11:18:43 +0200
commit4379433f23d663e4aa142089221f7ff2bc234e1b (patch)
tree977985e35e3097ead39f820f464b3f88d8b32b04 /src
parentc3ee8d97ea8a427abd455c903157da94623e83dd (diff)
downloadpies-4379433f23d663e4aa142089221f7ff2bc234e1b.tar.gz
pies-4379433f23d663e4aa142089221f7ff2bc234e1b.tar.bz2
Fix preprocessor use and config file precedence in piesctl
* NEWS: Document changes. * doc/pies.texi: Document changes. * src/cmdline.opt: Don't set preprocessor if DEFAULT_PREPROCESSOR is NULL. * src/piesctl-cl.opt: New options: --preprocessor, --no-preprocessor. * src/piesctl.c (parse_config): If either client.url or default_url is set in the program-specific config, use it and don't parse pies.conf. This is consistent with the documented behavior. (main): Initialize grecs_preprocessor.
Diffstat (limited to 'src')
-rw-r--r--src/cmdline.opt3
-rw-r--r--src/piesctl-cl.opt14
-rw-r--r--src/piesctl.c3
3 files changed, 18 insertions, 2 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index 95ede4c..83c8819 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -132,7 +132,8 @@ GROUP(Preprocessor)
132OPTION(preprocessor,,COMMAND, 132OPTION(preprocessor,,COMMAND,
133 [<use COMMAND instead of the default preprocessor>]) 133 [<use COMMAND instead of the default preprocessor>])
134BEGIN 134BEGIN
135 grecs_preprocessor = optarg; 135 if (DEFAULT_PREPROCESSOR)
136 grecs_preprocessor = optarg;
136END 137END
137 138
138OPTION(no-preprocessor,,, 139OPTION(no-preprocessor,,,
diff --git a/src/piesctl-cl.opt b/src/piesctl-cl.opt
index ea71d59..8a72703 100644
--- a/src/piesctl-cl.opt
+++ b/src/piesctl-cl.opt
@@ -77,6 +77,19 @@ END
77 77
78GROUP(Preprocessor) 78GROUP(Preprocessor)
79 79
80OPTION(preprocessor,,COMMAND,
81 [<use COMMAND instead of the default preprocessor>])
82BEGIN
83 if (DEFAULT_PREPROCESSOR)
84 grecs_preprocessor = optarg;
85END
86
87OPTION(no-preprocessor,,,
88 [<disable preprocessing>])
89BEGIN
90 grecs_preprocessor = NULL;
91END
92
80OPTION(include-directory,I,DIR, 93OPTION(include-directory,I,DIR,
81 [<add include directory>]) 94 [<add include directory>])
82BEGIN 95BEGIN
@@ -95,6 +108,7 @@ BEGIN
95 pp_add_option ("-U", optarg); 108 pp_add_option ("-U", optarg);
96END 109END
97 110
111
98OPTIONS_END 112OPTIONS_END
99 113
100void 114void
diff --git a/src/piesctl.c b/src/piesctl.c
index 44b3d0f..d88c441 100644
--- a/src/piesctl.c
+++ b/src/piesctl.c
@@ -168,7 +168,7 @@ parse_config (void)
168 program_name, file_name); 168 program_name, file_name);
169 } 169 }
170 170
171 if (!client.url) 171 if (!client.url && !default_url)
172 { 172 {
173 /* Try local instance configuration */ 173 /* Try local instance configuration */
174 file_name = mkfilename (SYSCONFDIR, instance, ".conf"); 174 file_name = mkfilename (SYSCONFDIR, instance, ".conf");
@@ -2322,6 +2322,7 @@ main (int argc, char **argv)
2322 textdomain (PACKAGE); 2322 textdomain (PACKAGE);
2323#endif 2323#endif
2324 grecs_print_diag_fun = piesctl_diag; 2324 grecs_print_diag_fun = piesctl_diag;
2325 grecs_preprocessor = DEFAULT_PREPROCESSOR;
2325 2326
2326 proginfo.print_help_hook = command_help; 2327 proginfo.print_help_hook = command_help;
2327 parse_options (argc, argv, &i); 2328 parse_options (argc, argv, &i);

Return to:

Send suggestions and report system problems to the System administrator.