Exemplo n.º 1
0
Arquivo: munxap.cs Projeto: ynkbt/moon
    static int Main(string [] args)
    {
        try {
            Munxap unxap = new Munxap();

            var p = new OptionSet()
            {
                { "h|?|help", v => unxap.Help = v != null },
            };

            List <string> rest = new List <string> ();
            try {
                rest = p.Parse(args);
            } catch (OptionException) {
                Console.Error.WriteLine("Try `munxap --help' for more information.");
                return(1);
            }

            if (unxap.Help)
            {
                ShowHelp(p);
                return(0);
            }

            if (rest.Count != 1)
            {
                ShowHelp(p);
                return(1);
            }

            unxap.File = rest [0];

            unxap.Show();

            return(0);
        } catch (Exception ex) {
            Console.WriteLine(ex);
            return(1);
        }
    }
Exemplo n.º 2
0
Arquivo: munxap.cs Projeto: dfr0/moon
	static int Main (string [] args)
	{
		try {
			Munxap unxap = new Munxap ();
			
			var p = new OptionSet () {
				{ "h|?|help", v => unxap.Help = v != null },
			};

			List<string> rest = new List<string> ();
			try {
				rest = p.Parse (args);
			} catch (OptionException){
				Console.Error.WriteLine ("Try `munxap --help' for more information.");
				return 1;
			}

			if (unxap.Help) {
				ShowHelp (p);
				return 0;
			}
			
			if (rest.Count != 1) {
				ShowHelp (p);
				return 1;
			}

			unxap.File = rest [0];
			
			unxap.Show ();
			
			return 0;
		} catch (Exception ex) {
			Console.WriteLine (ex);
			return 1;
		}
	}