Mono.Debugger.DebuggerOptions.ParseCommandLine C# (CSharp) Method

ParseCommandLine() public static method

public static ParseCommandLine ( string args ) : DebuggerOptions
args string
return DebuggerOptions
        public static DebuggerOptions ParseCommandLine(string[] args)
        {
            DebuggerOptions options = new DebuggerOptions ();
            int i;
            bool parsing_options = true;

            for (i = 0; i < args.Length; i++) {
                string arg = args[i];

                if (arg == "")
                    continue;

                if (!parsing_options) {
                    i--;
                    break;
                }

                if (arg.StartsWith ("-")) {
                    if (ParseOption (options, arg, ref args, ref i,
                             ref parsing_options))
                        continue;
                    Usage ();
                    Console.WriteLine ("Unknown argument: {0}", arg);
                    Environment.Exit (1);
                } else if (arg.StartsWith ("/")) {
                    string unix_opt = "-" + arg.Substring (1);
                    if (ParseOption (options, unix_opt, ref args, ref i,
                             ref parsing_options))
                        continue;
                }

                options.File = arg;
                break;
            }

            if (args.Length > i) {
                string[] argv = new string [args.Length - i - 1];
                Array.Copy (args, i + 1, argv, 0, args.Length - i - 1);
                options.InferiorArgs = argv;
            } else {
                options.InferiorArgs = new string [0];
            }

            return options;
        }