Example #1
0
        private static void ListFolders(XCom2Edition edition, string command)
        {
            Report.WriteLine("Names:");
            var folders = XCom2Browser.GetFolders();
            var length  = folders.Max(x => x.name.Length) + 2;

            foreach (var folder in folders)
            {
                var indent = new string(' ', length - folder.name.Length);
                Report.WriteLine($"  {folder.name}{indent}{folder.describe(edition)}");
                if (Report.Verbosity >= Verbosity.Verbose)
                {
                    indent = new string(' ', length);
                    string path;
                    try
                    {
                        path = folder.getPath(edition);
                    }
                    catch (Exception ex)
                    {
                        path = $"{ex.Message}";
                    }
                    Report.Verbose($"  {indent}{path}");
                    if (folder != folders.Last())
                    {
                        Report.WriteLine();
                    }
                }
            }
            if (Report.Verbosity < Verbosity.Verbose)
            {
                Report.WriteLine();
                Report.WriteLine($"Use '{Name} --verbose {command}' to see folder paths.");
            }
        }
Example #2
0
        private static void Clip(List <string> args, XCom2Edition edition)
        {
            if (args.Count != 1)
            {
                HelpClip(edition);
                return;
            }

            var folder = args[0];

            try
            {
                XCom2Browser.CopyToClipboard(folder, edition);
            }
            catch (ArgumentOutOfRangeException)
            {
                throw new InvalidOperationException($"'{folder}' is not a recognized folder. See '{Name} help clip'.");
            }
        }