aboutsummaryrefslogtreecommitdiff
path: root/src/cmdline.opt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.opt')
-rw-r--r--src/cmdline.opt52
1 files changed, 48 insertions, 4 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index b2b1a5f..c1b5850 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies. -*- c -*-
- Copyright (C) 2008-2020 Sergey Poznyakoff
+ Copyright (C) 2008-2023 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,11 +14,13 @@
You should have received a copy of the GNU General Public License
along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. */
+char *incpath = DEFAULT_INCLUDE_PATH;
+
OPTIONS_BEGIN("pies",
[<process invocation and execution supervisor>],
[<>],
[<gnu>],
- [<copyright_year=2008-2017>],
+ [<copyright_year=2008-2023>],
[<copyright_holder=Sergey Poznyakoff>])
GROUP(Operation Mode)
@@ -129,10 +131,28 @@ CPP(#endif)
GROUP(Preprocessor)
+OPTION(preprocessor,,COMMAND,
+ [<use COMMAND instead of the default preprocessor>])
+BEGIN
+ grecs_preprocessor = optarg;
+END
+
+OPTION(no-preprocessor,,,
+ [<disable preprocessing>])
+BEGIN
+ grecs_preprocessor = NULL;
+END
+
OPTION(include-directory,I,DIR,
[<add include directory>])
BEGIN
- grecs_preproc_add_include_dir(optarg);
+ pp_add_option ("-I", optarg);
+END
+
+OPTION(no-include,,,
+ [<clear default preprocessor search path>])
+BEGIN
+ incpath = NULL;
END
OPTION(define,D,[<NAME[=VALUE]>],
@@ -201,6 +221,13 @@ BEGIN
command = COM_TRACE_PREREQ;
END
+OPTION(list-shutdown-sequence,,,
+ [<list components in shutdown sequence ordering>])
+BEGIN
+ log_to_stderr_only = 1;
+ command = COM_LIST_SHUTDOWN_SEQUENCE;
+END
+
OPTION(source-info,,,
[<show source info with debugging messages>])
BEGIN
@@ -215,13 +242,29 @@ END
OPTIONS_END
+static void
+pies_help_hook (FILE *fp)
+{
+ if (DEFAULT_PREPROCESSOR)
+ {
+ fprintf (fp, _("This pies preprocesses its configuration using %s\n"),
+ DEFAULT_PREPROCESSOR);
+ fprintf (fp, _("Preprocessor include path: %s\n"),
+ DEFAULT_INCLUDE_PATH);
+ }
+ else
+ fprintf (fp, _("This pies does not use configuration preprocessor.\n"));
+ fputc ('\n', fp);
+}
+
void
parse_options (int *pargc, char ***pargv)
{
int argc = *pargc;
char **argv = *pargv;
int index;
-
+
+ proginfo.print_help_hook = pies_help_hook;
if (SYSVINIT_ACTIVE)
{
sysvinit_parse_argv (argc, argv);
@@ -230,6 +273,7 @@ parse_options (int *pargc, char ***pargv)
else
{
GETOPT(argc, argv, index);
+ pp_init (incpath);
}
*pargc -= index;
*pargv += index;

Return to:

Send suggestions and report system problems to the System administrator.