Beispiel #1
0
        static int Main(string [] args)
        {
            string topic = null;



            for (int i = 0; i < args.Length; i++)
            {
                switch (args [i])
                {
                case "--html":
                    if (i + 1 == args.Length)
                    {
                        Console.WriteLine("--html needed argument");
                        return(1);
                    }

                    Node     n;
                    RootTree help_tree = RootTree.LoadTree();
                    string   res       = help_tree.RenderUrl(args [i + 1], out n);
                    if (res != null)
                    {
                        Console.WriteLine(res);
                        return(0);
                    }
                    else
                    {
                        return(1);
                    }

                case "--make-index":
                    RootTree.MakeIndex();
                    return(0);

                case "--help":
                    Console.WriteLine("Options are:\n" +
                                      "browser [--html TOPIC] [--make-index] [TOPIC] [--merge-changes CHANGE_FILE TARGET_DIR+]");
                    return(0);

                case "--merge-changes":
                    if (i + 2 == args.Length)
                    {
                        Console.WriteLine("--merge-changes 2+ args");
                        return(1);
                    }

                    ArrayList targetDirs = new ArrayList();

                    for (int j = i + 2; j < args.Length; j++)
                    {
                        targetDirs.Add(args [j]);
                    }

                    EditMerger e = new EditMerger(
                        GlobalChangeset.LoadFromFile(args [i + 1]),
                        targetDirs
                        );

                    e.Merge();

                    return(0);

                default:
                    topic = args [i];
                    break;
                }
            }
            Settings.RunningGUI = true;
            DocumentBrowser browser = new DocumentBrowser();

            browser.Run();
            return(0);
        }
Beispiel #2
0
        static int Main(string [] args)
        {
            string topic = null;

            for (int i = 0; i < args.Length; i++){
            switch (args [i]){
            case "--html":
                if (i+1 == args.Length){
                    Console.WriteLine ("--html needed argument");
                    return 1;
                }

                Node n;
                RootTree help_tree = RootTree.LoadTree();
                string res = help_tree.RenderUrl (args [i+1], out n);
                if (res != null){
                    Console.WriteLine (res);
                    return 0;
                } else {
                    return 1;
                }
            case "--make-index":
                RootTree.MakeIndex ();
                return 0;

            case "--help":
                Console.WriteLine ("Options are:\n"+
                           "browser [--html TOPIC] [--make-index] [TOPIC] [--merge-changes CHANGE_FILE TARGET_DIR+]");
                return 0;

            case "--merge-changes":
                if (i+2 == args.Length) {
                    Console.WriteLine ("--merge-changes 2+ args");
                    return 1;
                }

                ArrayList targetDirs = new ArrayList ();

                for (int j = i+2; j < args.Length; j++)
                    targetDirs.Add (args [j]);

                EditMerger e = new EditMerger (
                    GlobalChangeset.LoadFromFile (args [i+1]),
                    targetDirs
                );

                e.Merge ();

                return 0;
            default:
                topic = args [i];
                break;
            }

            }
            Settings.RunningGUI = true;
            DocumentBrowser browser = new DocumentBrowser ();
            browser.Run();
            return 0;
        }