Пример #1
0
            public List <string> GetHelp(List <string> options)
            {
                MainConsole.Instance.Info("HTML mode: " + options.Contains("--html"));
                List <string> help = new List <string>();

                if (commandsets.Count != 0)
                {
                    help.Add("");
                    help.Add("------- Help Sets (type the name and help to get more info about that set) -------");
                    help.Add("");
                }
                List <string> paths = new List <string>();

                paths.AddRange(commandsets.Values.Select(set => string.Format("-- Help Set: {0}", set.Path)));

                help.AddRange(StringUtils.AlphanumericSort(paths));
                if (help.Count != 0)
                {
                    help.Add("");
                    help.Add("------- Help options -------");
                    help.Add("");
                }
                paths.Clear();

                paths.AddRange(
                    commands.Values.Select(
                        command =>
                        string.Format("-- {0}  [{1}]:   {2}", command.command, command.commandHelp, command.info)));

                help.AddRange(StringUtils.AlphanumericSort(paths));
                return(help);
            }
Пример #2
0
            public List <string> GetHelp()
            {
                List <string> help = new List <string>();

                if (commandsets.Count != 0)
                {
                    help.Add("");
                    help.Add("------- Help Sets (type the name and help to get more info about that set) -------");
                    help.Add("");
                }
                List <string> paths = new List <string>();

#if (!ISWIN)
                foreach (CommandSet set in commandsets.Values)
                {
                    paths.Add(string.Format("-- Help Set: {0}", set.Path));
                }
#else
                paths.AddRange(commandsets.Values.Select(set => string.Format("-- Help Set: {0}", set.Path)));
#endif
                help.AddRange(StringUtils.AlphanumericSort(paths));
                if (help.Count != 0)
                {
                    help.Add("");
                    help.Add("------- Help options -------");
                    help.Add("");
                }
                paths.Clear();
#if (!ISWIN)
                foreach (CommandInfo command in commands.Values)
                {
                    paths.Add(string.Format("-- {0}  [{1}]:   {2}", command.command, command.commandHelp, command.info));
                }
#else
                paths.AddRange(commands.Values.Select(command => string.Format("-- {0}  [{1}]:   {2}", command.command, command.commandHelp, command.info)));
#endif
                help.AddRange(StringUtils.AlphanumericSort(paths));
                return(help);
            }