diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-04 09:47:09 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-04 09:47:09 +0100 |
commit | d5d78969be2903d30b948ba14353e6d476eb32a8 (patch) | |
tree | ea076c969484635f3a4d53fc7b700decdbadef9e /src/cli.c | |
parent | f30a66ffe8752d370ad211f9e331ed25538a263e (diff) | |
download | biruda-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |