示例#1
0
文件: CLI.cs 项目: codacy-badger/Byt3
        /// <summary>
        /// The command handler that is used for the command --generate-readme
        /// </summary>
        /// <returns>Returns true if the CLI should exit after this command</returns>
        private bool ReadmeCommandHandler()
        {
            if (ReadmeArgs.Length == 2)
            {
                if (ReadmeArgs[0] == "self")
                {
                    Logger.Log(PPLogType.Log, Verbosity.Level1, "Generating Readme for self.");
                    List <string> ret = PluginExtensions.ToMarkdown(Info).ToList();
                    Logger.Log(PPLogType.Log, Verbosity.Level1, "Writing Readme to file: {0}", ReadmeArgs[1]);
                    File.WriteAllLines(ReadmeArgs[1], ret.ToArray());
                    return(true);
                }

                Logger.Log(PPLogType.Log, Verbosity.Level1, "Generating Readme for file: {0}", ReadmeArgs[0]);
                PluginManager.PluginManager pm = new PluginManager.PluginManager();
                List <string> ht = GenerateReadme(pm.FromFile(ReadmeArgs[0]));

                Logger.Log(PPLogType.Log, Verbosity.Level1, "Writing Readme to file: {0}", ReadmeArgs[1]);
                File.WriteAllLines(ReadmeArgs[1], ht.ToArray());
                return(true);
            }

            return(false);
        }
示例#2
0
文件: CLI.cs 项目: codacy-badger/Byt3
        /// <summary>
        /// Constructor that does the parameter analysis.
        /// </summary>
        /// <param name="args"></param>
        public CLI(string[] args)
        {
            pluginManager = new PluginManager.PluginManager();

            DoExecution(args);
        }