mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: Added an option to quiet the status output from binpac.
This adds the -q command line flag to quiet the output. It also fixes a small compiler warning.
This commit is contained in:
parent
c2dbefab17
commit
1a15b968e6
4 changed files with 14 additions and 4 deletions
|
@ -12,6 +12,7 @@
|
|||
using namespace std;
|
||||
|
||||
extern bool FLAGS_pac_debug;
|
||||
extern bool FLAGS_quiet;
|
||||
extern vector<string> FLAGS_include_directories;
|
||||
extern string input_filename;
|
||||
extern int line_number;
|
||||
|
|
|
@ -21,6 +21,7 @@ extern void switch_to_file(FILE* fp_input);
|
|||
string input_filename;
|
||||
|
||||
bool FLAGS_pac_debug = false;
|
||||
bool FLAGS_quiet = false;
|
||||
string FLAGS_output_directory;
|
||||
vector<string> FLAGS_include_directories;
|
||||
|
||||
|
@ -192,6 +193,7 @@ void usage()
|
|||
fprintf(stderr, " <pac files> | pac-language input files\n");
|
||||
fprintf(stderr, " -d <dir> | use given directory for compiler output\n");
|
||||
fprintf(stderr, " -D | enable debugging output\n");
|
||||
fprintf(stderr, " -q | stay quiet\n");
|
||||
fprintf(stderr, " -h | show command line help\n");
|
||||
fprintf(stderr, " -I <dir> | include <dir> in input file search path\n");
|
||||
exit(1);
|
||||
|
@ -203,7 +205,7 @@ int main(int argc, char* argv[])
|
|||
extern char *malloc_options;
|
||||
#endif
|
||||
int o;
|
||||
while ( (o = getopt(argc, argv, "DI:d:h")) != -1 )
|
||||
while ( (o = getopt(argc, argv, "DqI:d:h")) != -1 )
|
||||
{
|
||||
switch(o)
|
||||
{
|
||||
|
@ -214,6 +216,10 @@ int main(int argc, char* argv[])
|
|||
malloc_options = "A";
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
FLAGS_quiet = true;
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
// Add to FLAGS_include_directories
|
||||
|
|
|
@ -313,7 +313,8 @@ void switch_to_file(const char *filename)
|
|||
input_filename = string(filename);
|
||||
line_number = 1;
|
||||
switch_to_file(yyin);
|
||||
fprintf(stderr, "switching to file %s\n", input_filename.c_str());
|
||||
if ( !FLAGS_quiet )
|
||||
fprintf(stderr, "switching to file %s\n", input_filename.c_str());
|
||||
}
|
||||
|
||||
void include_file(const char *filename)
|
||||
|
|
|
@ -94,7 +94,8 @@ void TypeDecl::GenCode(Output* out_h, Output* out_cc)
|
|||
if ( type_->tot() == Type::EXTERN || type_->tot() == Type::STRING )
|
||||
return;
|
||||
|
||||
fprintf(stderr, "Generating code for %s\n", class_name().c_str());
|
||||
if ( !FLAGS_quiet )
|
||||
fprintf(stderr, "Generating code for %s\n", class_name().c_str());
|
||||
|
||||
if ( RequiresAnalyzerContext::compute(type_) )
|
||||
{
|
||||
|
@ -125,7 +126,8 @@ void TypeDecl::GenCode(Output* out_h, Output* out_cc)
|
|||
out_h->println("");
|
||||
out_h->print("class %s", class_name().c_str());
|
||||
bool first = true;
|
||||
foreach(i, vector<string>, &base_classes)
|
||||
vector<string>::iterator i;
|
||||
for ( i = (&base_classes)->begin(); i != (&base_classes)->end(); ++i )
|
||||
{
|
||||
if ( first )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue