예제 #1
0
        new public string PrintHelpText()
        {
            StringBuilder help = new StringBuilder();

            help.AppendLine("Required flags");
            foreach (var prop in this.GetType().GetProperties())
            {
                if (prop.GetCustomAttributes(typeof(CommandLineArgAttribute), true).FirstOrDefault() is CommandLineArgAttribute cmdAttribute)
                {
                    help.AppendFormat("{0,-40}\t\t{1,-100}", cmdAttribute.Usage, cmdAttribute.Description);
                    //if (!String.IsNullOrWhiteSpace (cmdAttribute.DefaultValue))
                    //    help.AppendFormat ("\t Default:{0,-40}\n", cmdAttribute.DefaultValue);
                    //else
                    //    help.Append ("\n");
                }
            }
            help.AppendLine(new String('-', 180));
            help.AppendLine("InfluxDB related flags");
            help.Append(InfluxDB.PrintHelpText());
            help.AppendLine(new String('-', 180));
            help.AppendLine("Perfmon file format related flags");
            help.Append(PerfmonFile.PrintHelpText());
            help.AppendLine(new String('-', 180));
            help.AppendLine("Generic delimited file format related flags");
            help.Append(GenericFile.PrintHelpText());

            return(help.ToString());
        }
예제 #2
0
        new public bool ProcessCommandLineArguments(Dictionary <string, string> CommandLine)
        {
            if (CommandLine == null || CommandLine.Count == 0)
            {
                return(true);
            }

            bool ret1, ret2, ret3;

            ret1 = base.ProcessCommandLineArguments(CommandLine);

            ret2 = InfluxDB.ProcessCommandLineArguments(CommandLine);

            if (FileFormat == FileFormats.Perfmon)
            {
                ret3 = PerfmonFile.ProcessCommandLineArguments(CommandLine);
            }
            else
            {
                ret3 = GenericFile.ProcessCommandLineArguments(CommandLine);
            }

            return(ret1 || ret2 || ret3);
        }