Changeset 2608

Show
Ignore:
Timestamp:
05/09/12 12:27:04 (13 months ago)
Author:
peter
Message:

make sure pdns_server --version works even if guardian or daemon are enabled. Fixes #456, reported by several.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/receiver.cc

    r2556 r2608  
    415415    declareArguments(); 
    416416    UNIX_declareArguments(); 
    417        
     417 
    418418    ::arg().laxParse(argc,argv); // do a lax parse 
    419419     
     420    if(::arg().mustDo("version")) { 
     421      cerr<<"Version: "VERSION", compiled on "<<__DATE__", "__TIME__; 
     422#ifdef __GNUC__  
     423      cerr<<" with gcc version "<<__VERSION__; 
     424#endif 
     425      cout<<endl; 
     426      exit(99); 
     427    } 
     428 
    420429    if(::arg()["config-name"]!="")  
    421430      s_programname+="-"+::arg()["config-name"]; 
     
    456465    } 
    457466 
    458     if(::arg().mustDo("version")) { 
    459       cerr<<"Version: "VERSION", compiled on "<<__DATE__", "__TIME__; 
    460 #ifdef __GNUC__  
    461       cerr<<" with gcc version "<<__VERSION__; 
    462 #endif 
    463       cout<<endl; 
    464       exit(99); 
    465     } 
    466467     
    467468    // we really need to do work - either standalone or as an instance