Пример #1
0
        public void DisplayVersionAndQuit()
        {
            string version = Program.GetFullVersion();

            if (Program.isRedirected)
            {
                Console.SetOut(new System.IO.StreamWriter(Console.OpenStandardOutput())
                {
                    AutoFlush = true
                });
            }
            Console.Write(version);
            Environment.Exit(0);
        }
Пример #2
0
        public void DisplayHelpAndQuit()
        {
            string version = Program.GetFullVersion();
            string shrtKey = "", longKey = "";

            if (Program.isRedirected)
            {
                Console.SetOut(new System.IO.StreamWriter(Console.OpenStandardOutput())
                {
                    AutoFlush = true
                });
            }
            Program.Message(version + ". You can use <c:White>hdsdump</c> with following switches:");
            Program.Message("");
            foreach (KeyValuePair <string, string> pair in ACCEPTED[0])
            {
                shrtKey = pair.Key.Split('|')[0].Trim();
                longKey = pair.Key.Split('|')[1].Trim();
                if (shrtKey == "")
                {
                    Program.Message(String.Format("     <c:White>--{0,-17} <c:DarkCyan>{1}", longKey, pair.Value));
                }
                else
                {
                    Program.Message(String.Format(" <c:White>-{0,-2}</c>|<c:White>--{1,-17}</c> <c:DarkCyan>{2}", shrtKey, longKey, pair.Value));
                }
            }
            foreach (KeyValuePair <string, string> pair in ACCEPTED[1])
            {
                shrtKey = pair.Key.Split('|')[0].Trim();
                longKey = pair.Key.Split('|')[1].Trim();
                if (shrtKey == "")
                {
                    Program.Message(String.Format("     <c:White>--{0,-10}</c><param> <c:DarkCyan>{1,-7}", longKey, pair.Value));
                }
                else
                {
                    Program.Message(String.Format(" <c:White>-{0,-2}</c>|<c:White>--{1,-10}</c><param> <c:DarkCyan>{2,-7}", shrtKey, longKey, pair.Value));
                }
            }
            Environment.Exit(0);
        }