summaryrefslogtreecommitdiff
path: root/src/main/ProcessCommandLine.c
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2006-06-23 04:16:13 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2006-06-23 04:16:13 +0000
commita5554988d7b607ddb66ac499f3f9ceb74a35f31d (patch)
treec030a082c7512f973e8859911a2ec74f2a969c6e /src/main/ProcessCommandLine.c
parent4d5f9ed6fdc103aa509c79e14d1ec4680e643925 (diff)
Add a new command line option to select the buffering mode of stdout.
The option is "-b <mode>", or "-buffering=<mode>", where mode can be "no", "line", or "full". This option uses the ANSI C function call setvbuf() to select the corresponding buffering mode. The buffering mode can be selected only once in a portable programme, and it has to be selected before the first output occurs. This means that it has to be implemented in the flesh. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4329 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/ProcessCommandLine.c')
-rw-r--r--src/main/ProcessCommandLine.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/ProcessCommandLine.c b/src/main/ProcessCommandLine.c
index 3c19b6c6..57543700 100644
--- a/src/main/ProcessCommandLine.c
+++ b/src/main/ProcessCommandLine.c
@@ -135,6 +135,7 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa
{"error-level", required_argument, NULL, 'E'},
{"parameter-level", required_argument, NULL, 256},
{"redirect", optional_argument, NULL, 'r'},
+ {"buffering", required_argument, NULL, 'b'},
{"print-schedule", no_argument, NULL, 'S'},
{"list-thorns", no_argument, NULL, 'T'},
{"test-thorn-compiled", required_argument, NULL, 't'},
@@ -143,7 +144,7 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa
{0, 0, 0, 0}
};
- c = getopt_long_only (argc, argv, "hO::o:x::L:W:E:r::STt:vi",
+ c = getopt_long_only (argc, argv, "hO::o:x::L:W:E:r::b:STt:vi",
long_options, &option_index);
if (c == -1)
break;
@@ -161,6 +162,7 @@ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigDa
case 'E': CCTKi_CommandLineErrorLevel(optarg); break;
case 256: CCTKi_CommandLineParameterLevel(optarg); break;
case 'r': CCTKi_CommandLineRedirect(optarg); break;
+ case 'b': CCTKi_CommandLineSetBuffering(optarg); break;
case 'S': CCTKi_CommandLinePrintSchedule(); break;
case 'T': CCTKi_CommandLineListThorns(); break;
case 'v': CCTKi_CommandLineVersion(); break;