Beispiel #1
0
        public Rotater( string[] args )
        {
            this._argsParser = null;
            this._globalConfig = new LogrotateConf();
            this._filePathConfigSection = new Dictionary<string, LogrotateConf>();
            this._status = null;

            this.Init( args );
        }
Beispiel #2
0
        bool Init( string[] args )
        {
            if ( args.Length == 0 )
            {
                this.PrintVersion();
                this.PrintUsage();
                return false;
                //Environment.Exit(0);
            }

            this._argsParser = new ArgsParser( args );
            if ( this._argsParser.Usage )
            {
                this.PrintUsage();
                return false;
                //Environment.Exit(0);
            }

            this._status = new LogrotateStatus( this._argsParser.AlternateStateFile );

            // now process the config files
            foreach ( string str in this._argsParser.ConfigFilePaths )
            {
                this.ProcessConfigPath( str );
            }
            return true;
        }