summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-12-04 09:47:09 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2014-12-04 09:47:09 +0100
commitd5d78969be2903d30b948ba14353e6d476eb32a8 (patch)
treeea076c969484635f3a4d53fc7b700decdbadef9e /src/cli.c
parentf30a66ffe8752d370ad211f9e331ed25538a263e (diff)
downloadbiruda-d5d78969be2903d30b948ba14353e6d476eb32a8.tar.gz
biruda-d5d78969be2903d30b948ba14353e6d476eb32a8.tar.bz2
added a -F <commandfile> option for easier batch execution
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cli.c b/src/cli.c
index 3f2e7fd..253f104 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -200,7 +200,7 @@ static void stop_worker( const char *worker_name )
}
}
-int start_interactive( bool colors )
+int start_interactive( bool colors, FILE *in )
{
char history_filename[1024];
@@ -208,7 +208,7 @@ int start_interactive( bool colors )
http_server = "localhost";
http_port = 8080;
- is_interactive = isatty( fileno( stdin ) );
+ is_interactive = isatty( fileno( in ) );
print_colors = is_interactive ? colors : false;
if( is_interactive ) {
@@ -257,7 +257,7 @@ int start_interactive( bool colors )
free( line );
line = buf;
} else {
- if( fgets( buf, sizeof( buf ), stdin ) == NULL ) {
+ if( fgets( buf, sizeof( buf ), in ) == NULL ) {
cleanup_worker_names( );
return EXIT_SUCCESS;
}