Mono.Documentation.MDoc.GetCommand C# (CSharp) Method

GetCommand() private method

private GetCommand ( string command ) : MDocCommand
command string
return MDocCommand
		internal MDocCommand GetCommand (string command)
		{
			MDocCommand h;
			if (!subcommands.TryGetValue (command, out h)) {
				Error ("Unknown command: {0}.", command);
			}
			h.TraceLevel  = (TraceLevel) verbosity;
			h.DebugOutput = debug;
			return h;
		}

Usage Example

Example #1
0
 public override void Run(IEnumerable <string> args)
 {
     if (args != null && args.Count() > 1)
     {
         foreach (var arg in args.Skip(1))
         {
             instance.GetCommand(arg).Run(new string[] { arg, "--help" });
         }
         return;
     }
     Message(TraceLevel.Warning,
             "usage: mdoc COMMAND [OPTIONS]\n" +
             "Use `mdoc help COMMAND' for help on a specific command.\n" +
             "\n" +
             "Available commands:\n\n   " +
             string.Join("\n   ", instance.subcommands.Keys.OrderBy(v => v).ToArray()) +
             "\n\n" +
             "mdoc is a tool for documentation management.\n" +
             "For additional information, see http://www.mono-project.com/"
             );
 }