summaryrefslogtreecommitdiffabout
path: root/src/main.c
authorSergey Poznyakoff <gray@gnu.org.ua>2005-09-25 15:16:08 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2005-09-25 15:16:08 (GMT)
commit48da77a9b7f2dd5484026314a4e64dc54781bdf5 (patch) (side-by-side diff)
treecf16000e93cb16832de16f7444dad2d0212ffa27 /src/main.c
parent87170f8072ccdcaa24eaf2e5cf82f7cbf5b34948 (diff)
downloadcflow-48da77a9b7f2dd5484026314a4e64dc54781bdf5.tar.gz
cflow-48da77a9b7f2dd5484026314a4e64dc54781bdf5.tar.bz2
Handle new --emacs option.
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 174445e..0e2c6aa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,6 +30,7 @@ static char doc[] = N_("generate a program flowgraph");
#define OPT_DEBUG 258
#define OPT_PREPROCESS 259
#define OPT_NO_PREPROCESS 260
+#define OPT_EMACS 261
static struct argp_option options[] = {
#define GROUP_ID 0
@@ -112,6 +113,8 @@ static struct argp_option options[] = {
N_("Draw ASCII art tree"), GROUP_ID+1 },
{ "brief", 'b', N_("BOOL"), OPTION_ARG_OPTIONAL,
N_("Brief output"), GROUP_ID+1 },
+ { "emacs", OPT_EMACS, NULL, 0,
+ N_("Additionally format output for use with GNU Emacs"), GROUP_ID+1 },
#undef GROUP_ID
#define GROUP_ID 30
{ NULL, 0, NULL, 0,
@@ -168,6 +171,7 @@ int print_as_tree; /* Print as tree */
int brief_listing; /* Produce short listing */
int reverse_tree; /* Generate reverse tree */
int max_depth; /* The depth at which the flowgraph is cut off */
+int emacs_option; /* Format and check for use with Emacs cflow-mode */
#define SM_FUNCTIONS 0x0001
#define SM_DATA 0x0002
@@ -512,6 +516,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
case OPT_DEFINES:
record_defines = 1;
break;
+ case OPT_EMACS:
+ emacs_option = 1;
+ break;
case 'f':
if (select_output_driver(arg))
argp_error(state, _("%s: No such output driver"), optarg);
@@ -675,7 +682,7 @@ main(int argc, char **argv)
if (getenv ("POSIXLY_CORRECT")) {
if (select_output_driver("posix"))
- error(0, _("%s: No such output driver"), "posix");
+ error(1, 0, _("%s: No such output driver"), "posix");
output_init();
}

Return to:

Send suggestions and report system problems to the System administrator.