예제 #1
0
        private static void DisplayUsageText()
        {
            Console.WriteLine("ApplicationName: {0} {1}", Startup.Application.ApplicationName,
                              Startup.Application.ApplicationVersion);
            Console.WriteLine("ApplicationBasePath: {0}", Startup.Application.ApplicationBasePath);
            Console.WriteLine("Framework: {0}", Startup.Application.RuntimeFramework.FullName);
            //    Console.WriteLine("_runtime: {0} {1} {2}", Startup.Runtime.RuntimeType, Startup.Runtime.RuntimeArchitecture, Startup.Runtime.RuntimeVersion);
            //      Console.WriteLine("System: {0} {1}", Startup.Runtime.OperatingSystem, Startup.Runtime.OperatingSystemVersion);


            Console.WriteLine("Usage:");
            Console.WriteLine();
            IEnumerable <Common.ArgumentDescriptor> args = new Common.ArgumentDescriptor[]
            {
                new Common.ArgumentDescriptor()
                {
                    Argument = "dnx run ", PostArguments = "<command> [<arguments....>]"
                }
            };

            Console.WriteLine(FormatArgumentDescriptors(args, Startup.DisplayWidth));
            Console.WriteLine("Commands:");
            Console.WriteLine();
            args = new Common.ArgumentDescriptor[]
            {
                new Common.ArgumentDescriptor()
                {
                    Argument    = "/list",
                    Description = "Displays a list of tasks available."
                },
                new Common.ArgumentDescriptor()
                {
                    Argument = "/help", Description = "Displays this help text."
                },
                new Common.ArgumentDescriptor()
                {
                    Argument      = "/help",
                    PostArguments = "<task code>",
                    Description   =
                        "Displays help text for the specific task including arguments usage and scheduling details."
                },
                new Common.ArgumentDescriptor()
                {
                    Argument      = "/run",
                    PostArguments = "<task code> [arguments]",
                    Description   = "Runs a specific task given its identifier code with optional arguments for the task."
                },
            };
            Console.WriteLine(FormatArgumentDescriptors(args, Startup.DisplayWidth));
            Console.WriteLine("Purpose:");
            Console.WriteLine();
            Console.WriteLine("  " + string.Join(
                                  Environment.NewLine + "  ",
                                  ("This tool is intended to be used as a Windows Scheduled Task. The scheduled " +
                                   "task command line should use a /run command with a specific task code to run. " +
                                   "The other commands are intended for off-line usage to help the administrator " +
                                   "configure the scheduled tasks.").WordWrap(Startup.DisplayWidth - 3).ToArray()
                                  ));
            Console.WriteLine();
        }
예제 #2
0
        private static void DisplayUsageText()
        {
            Console.WriteLine("ApplicationName: {0} {1}", Startup.Application.ApplicationName, Startup.Application.ApplicationVersion);
            Console.WriteLine("ApplicationBasePath: {0}", Startup.Application.ApplicationBasePath);
            Console.WriteLine("Framework: {0}", Startup.Application.RuntimeFramework.FullName);
            Console.WriteLine("_runtime: {0} {1} {2}", Startup.Runtime.RuntimeType, Startup.Runtime.RuntimeArchitecture, Startup.Runtime.RuntimeVersion);
            Console.WriteLine("System: {0} {1}", Startup.Runtime.OperatingSystem, Startup.Runtime.OperatingSystemVersion);


            Console.WriteLine("Usage:");
            Console.WriteLine();
            IEnumerable<Common.ArgumentDescriptor> args = new Common.ArgumentDescriptor[] {
                new Common.ArgumentDescriptor() { Argument = "dnx run ", PostArguments = "<command> [<arguments....>]" }
            };

            Console.WriteLine(FormatArgumentDescriptors(args, Startup.DisplayWidth));
            Console.WriteLine("Commands:");
            Console.WriteLine();
            args = new Common.ArgumentDescriptor[] {
                new Common.ArgumentDescriptor() { Argument = "/list", Description = "Displays a list of tasks available." },
                new Common.ArgumentDescriptor() { Argument = "/help", Description = "Displays this help text." },
                new Common.ArgumentDescriptor() { Argument = "/help", PostArguments = "<task code>", Description = "Displays help text for the specific task including arguments usage and scheduling details." },
                new Common.ArgumentDescriptor() { Argument = "/run", PostArguments = "<task code> [arguments]", Description = "Runs a specific task given its identifier code with optional arguments for the task." },
            };
            Console.WriteLine(FormatArgumentDescriptors(args, Startup.DisplayWidth));
            Console.WriteLine("Purpose:");
            Console.WriteLine();
            Console.WriteLine("  " + string.Join(
                Environment.NewLine + "  ",
                ("This tool is intended to be used as a Windows Scheduled Task. The scheduled " +
                "task command line should use a /run command with a specific task code to run. " +
                "The other commands are intended for off-line usage to help the administrator " +
                "configure the scheduled tasks.").WordWrap(Startup.DisplayWidth - 3).ToArray()
            ));
            Console.WriteLine();
        }