public static RawCommands FromJson(string json)
        {
            RawCommands commands = new RawCommands()
            {
                Commands = JsonConvert.DeserializeObject <List <RawCommand> >(json, Settings)
            };

            commands.Commands.Sort((item1, item2) =>
            {
                return(string.Compare(item1.Usage, item2.Usage, StringComparison.OrdinalIgnoreCase));
            });

            return(commands);
        }
        private static void ParseCommands(string commandFile, string outputFolder)
        {
            using (StreamReader reader = new StreamReader(commandFile))
            {
                RawCommands       rawCommands = RawCommands.FromJson(reader.ReadToEnd());
                ProcessedCommands processedModeratorCommands = new ProcessedCommands();
                ProcessedCommands processedViewerCommands    = new ProcessedCommands();
                ProcessedCommands processedPawnCommands      = new ProcessedCommands();

                foreach (RawCommand rawCommand in rawCommands.Commands)
                {
                    if (string.IsNullOrWhiteSpace(rawCommand.Name))
                    {
                        continue;
                    }

                    if (rawCommand.Usage.StartsWith("!rwdata"))
                    {
                        continue;
                    }

                    ProcessedCommand processedCommand = ProcessedCommand.FromRawCommand(rawCommand);

                    if (rawCommand.UserLevel == UserLevel.Moderator)
                    {
                        processedModeratorCommands.Commands.Add(processedCommand);
                    }
                    else
                    {
                        if (IsPawnCommand(rawCommand.Usage))
                        {
                            processedPawnCommands.Commands.Add(processedCommand);
                        }
                        else
                        {
                            processedViewerCommands.Commands.Add(processedCommand);
                        }
                    }
                }

                string outputFileModerator = Path.Combine(outputFolder, "SiteCommandsModerator.json");
                string outputFileViewer    = Path.Combine(outputFolder, "SiteCommandsViewer.json");
                string outputFilePawn      = Path.Combine(outputFolder, "SiteCommandsPawn.json");

                GenerateCommandsOutput(processedModeratorCommands, outputFileModerator);
                GenerateCommandsOutput(processedViewerCommands, outputFileViewer);
                GenerateCommandsOutput(processedPawnCommands, outputFilePawn);
            }
        }