aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-03-22 11:15:15 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-03-22 11:15:15 +0000
commit2e152a35f7ff844f4b664178ec285dfedd89d4fa (patch)
tree834893b8f914aa6d22d6344add80aac9bc33096d /src/main.c
parentd2fa7fa0fa8d2b398081820f005ad3e6ba939eea (diff)
downloadcflow-2e152a35f7ff844f4b664178ec285dfedd89d4fa.tar.gz
cflow-2e152a35f7ff844f4b664178ec285dfedd89d4fa.tar.bz2
(ignore_indentation): Renamed to use_indentation,
sense reverted. All callers updated New options: --cpp, alias to --preprocess. --no-cpp, disables preprocessing
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 7b4d076..f6a9d8d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -27,7 +27,8 @@ static char doc[] = "";
#define OPT_DEFINES 256
#define OPT_LEVEL_INDENT 257
#define OPT_DEBUG 258
-#define OPT_PREPROCESSOR 259
+#define OPT_PREPROCESS 259
+#define OPT_NO_PREPROCESS 260
static struct argp_option options[] = {
#define GROUP_ID 0
@@ -54,8 +55,8 @@ static struct argp_option options[] = {
#define GROUP_ID 10
{ NULL, 0, NULL, 0,
"Parser control:", GROUP_ID },
- { "ignore-indentation", 'S', NULL, 0,
- "do not rely on indentation", GROUP_ID+1 },
+ { "use-indentation", 'S', "BOOL", OPTION_ARG_OPTIONAL,
+ "rely on indentation", GROUP_ID+1 },
{ "ansi", 'a', NULL, 0,
"Assume input to be written in ANSI C", GROUP_ID+1 },
{ "pushdown", 'p', "NUMBER", 0,
@@ -70,8 +71,12 @@ static struct argp_option options[] = {
"Cancel any previous definition of NAME", GROUP_ID+1 },
{ "include-dir", 'I', "DIR", 0,
"Add the directory dir to the list of directories to be searched for header files.", GROUP_ID+1 },
- { "preprocessor", OPT_PREPROCESSOR, "COMMAND", 0,
+ { "preprocess", OPT_PREPROCESS, "COMMAND", OPTION_ARG_OPTIONAL,
"Run the specified preprocessor command", GROUP_ID+1 },
+ { "cpp", 0, NULL, OPTION_ALIAS, NULL, GROUP_ID+1 },
+ { "no-preprocess", OPT_NO_PREPROCESS, NULL, 0,
+ "Do not preprocess the sources", GROUP_ID+1 },
+ { "no-cpp", 0, NULL, OPTION_ALIAS, NULL, GROUP_ID+1 },
#undef GROUP_ID
#define GROUP_ID 20
{ NULL, 0, NULL, 0,
@@ -126,8 +131,8 @@ int debug; /* debug level */
char *outname = "-"; /* default output file name */
int print_option = 0; /* what to print. */
int verbose; /* be verbose on output */
-int ignore_indentation; /* Don't rely on indentation,
- * i.e. don't suppose the function body
+int use_indentation; /* Rely on indentation,
+ * i.e. suppose the function body
* is necessarily surrounded by the curly braces
* in the first column
*/
@@ -456,7 +461,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
set_print_option(arg);
break;
case 'S':
- ignore_indentation = 1;
+ use_indentation = boolean_value(arg);
break;
case 'T':
print_as_tree = 1;
@@ -527,8 +532,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
case 'x':
print_option = PRINT_XREF;
break;
- case OPT_PREPROCESSOR:
- set_preprocessor(arg);
+ case OPT_PREPROCESS:
+ set_preprocessor(arg ? arg : CFLOW_PREPROC);
+ break;
+ case OPT_NO_PREPROCESS:
+ set_preprocessor(NULL);
break;
case ARGP_KEY_ARG:
add_name(arg);

Return to:

Send suggestions and report system problems to the System administrator.