Пример #1
0
        private static int Docs(IList<string> args)
        {
            Driver d = new Driver ();

            try {
                d.RunDocs ();
            } catch (Exception e) {
                Console.WriteLine ("error while serving application:");
                Console.WriteLine (e);
                return 1;
            }

            return 0;
        }
Пример #2
0
        private static int Init(IList<string> args)
        {
            if (args.Count < 1) {
                Console.WriteLine ("manos --init <AppName>");
                Console.WriteLine ("This will initialize a new application with the supplied name.");
            }

            Driver d = new Driver ();

            try {
                Console.WriteLine ("initing: {0}", args [0]);
                d.Init (args [0]);
            } catch (Exception e) {
                Console.WriteLine ("error while initializing application:");
                Console.WriteLine (e);
                return 1;
            }

            return 0;
        }
Пример #3
0
        private static int Init(IList<string> args)
        {
            if (args.Count < 1) {
                Console.WriteLine (string.Format ("{0} --init <AppName>", MANOS_TOOLNAME));
                Console.WriteLine ("This will initialize a new application with the supplied name.");
            }

            Driver d = new Driver ();

            if (args.Count <= 0) {
                Console.WriteLine ("Error: Unable to init without an AppName.");
                return 1;
            }

            try {
                Console.WriteLine ("initing: {0}", args [0]);
                d.Init (args [0]);
            } catch (Exception e) {
                Console.WriteLine ("error while initializing application:");
                Console.WriteLine (e);
                return 1;
            }

            return 0;
        }
Пример #4
0
        private static int Init(IList<string> args)
        {
            string layout = null;
            var p = new OptionSet() {
                { "-l|layout=", v => layout = v },
            };

            Driver d = new Driver ();

            try {

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

                if (extra.Count < 1)
                {
                    Console.WriteLine("manos [--layout=<LayoutName>] --init <AppName>");
                    Console.WriteLine("This will initialize a new application with the supplied name.");
                }

                if (layout == null)
                    layout = "default";
                string appname = extra[0];

                Console.WriteLine("initing: {0} with layout {1}", appname, layout);

                InitCommand initer = new InitCommand(Environment, appname);
                initer.Layout = layout;

                initer.Run();
            }
            catch (Exception e)
            {
                Console.WriteLine ("error while initializing application:");
                Console.WriteLine (e);
                return 1;
            }

            return 0;
        }
Пример #5
0
        private static int Build(IList<string> args)
        {
            var d = new Driver();

            try
            {
                d.RunBuild();
            }
            catch (Exception e)
            {
                Console.WriteLine("error while building application:");
                Console.WriteLine(e);
                return 1;
            }

            return 0;
        }