예제 #1
0
파일: mdbrebase.cs 프로젝트: nobled/mono
	static int Main (string[] args) {
		var s = new Settings ();
		bool showHelp = false;

		var p = new OptionSet () {
			{ "d=|output=",  "Output directory to the mdb file, replace existing one if ommited", v => s.OutputDirectory = v },
			{ "v|verbose", "Be verbose with output (show individual path rewrites)", v => s.Verbose = true },
			{ "f|filenames", "Only operate on file names, not full absolute paths", v => s.FileNamesOnly = true },
			{ "r|regex", "Input pattern is a regular expression", v => s.InputPatternIsRegex = true },
			{ "i=|input-pattern=", "Input pattern to replace (must not be a prefix to output-pattern)(required)", v => s.InputPattern = v },
			{ "o=|output-pattern=", "Output pattern to replace (required)", v => s.OutputPattern = v },
			{ "h|?|help", v => showHelp = true },
		};

		List <string> extra = p.Parse (args);

		if (showHelp || extra.Count < 1 || !s.Validate ())
			Usage (p);

		var m = new MdbRebase (s);
		foreach (var a in extra)
			m.RewriteMdbFile (a);
		return 0;

	}
예제 #2
0
파일: mdbrebase.cs 프로젝트: nobled/mono
	public MdbRebase (Settings settings)
	{
		this.settings = settings;
	}
예제 #3
0
파일: mdbrebase.cs 프로젝트: itguy327/mono
	static int Main (string[] args) {
		var s = new Settings ();
		bool showHelp = false;

		var p = new OptionSet () {
			{ "d=|output=",  "Output directory to the mdb file, replace existing one if ommited", v => s.OutputDirectory = v },
			{ "i=|input-pattern=", "Input pattern to replace (must not be a prefix to output-pattern)(required)", v => s.InputPattern = v },
			{ "o=|output-pattern=", "Output pattern to replace (required)", v => s.OutputPattern = v },
			{ "h|?|help", v => showHelp = true },
		};

		List <string> extra = p.Parse (args);

		if (showHelp || extra.Count < 1 || !s.Validate ())
			Usage (p);

		var m = new MdbRebase (s);
		foreach (var a in extra)
			m.RewriteMdbFile (a);
		return 0;

	}