Beispiel #1
0
        static public int Main(string[] args)
        {
            // Handle the arguments
            if (args == null || args.Length == 0)
            {
                WriteLicense();
                return(8);
            }

            RdlCmd rc = new RdlCmd();

            char[]   breakChars = new char[] { '+' };
            string[] files      = null;
            string[] types      = null;
            string   dir        = null;
            int      returnCode = 0;

            foreach (string s in args)
            {
                string t = s.Substring(0, 2);
                switch (t)
                {
                case "/l":
                case "-l":
                    WriteLicense();
                    return(0);

                case "/f":
                case "-f":
                    files = s.Substring(2).Split(breakChars);
                    break;

                case "/o":
                case "-o":
                    dir = s.Substring(2);
                    break;

                case "/p":
                case "-p":
                    rc._DataSourcePassword = s.Substring(2);
                    break;

                case "/t":
                case "-t":
                    types = s.Substring(2).Split(breakChars);
                    break;

                case "/?":
                case "-?":
                    WriteHelp();
                    return(0);

                case "/s":
                case "-s":
                    rc._ShowStats = true;
                    break;

                case "/i":
                case "-i":
                    rc._StampInfo = s.Substring(2);
                    break;

                default:
                    Console.WriteLine("Unknown command '{0}' ignored.", s);
                    returnCode = 4;
                    break;
                }
            }
            if (files == null)
            {
                Console.WriteLine("/f parameter is required.");
                return(8);
            }

            if (types == null)
            {
                Console.WriteLine("/t parameter is required.");
                return(8);
            }

            if (dir == null)
            {
                dir = Environment.CurrentDirectory;
            }

            if (dir[dir.Length - 1] != Path.DirectorySeparatorChar)
            {
                dir += Path.DirectorySeparatorChar;
            }

            rc.returnCode = returnCode;

            rc.DoRender(dir, files, types);

            return(rc.returnCode);
        }
Beispiel #2
0
        public static int Main(string[] args)
        {
            // Handle the arguments
            if (args == null || args.Length==0)
            {
                WriteLicense();
                return 8;
            }

            RdlCmd rc = new RdlCmd();

            char[] breakChars = new char[] {'+'};
            string[] files=null;
            string[] types=null;
            string dir=null;
            int returnCode=0;
            foreach(string s in args)
            {
                string t = s.Substring(0,2);
                switch (t)
                {
                    case "/l":
                    case "-l":
                        WriteLicense();
                        return 0;
                    case "/f":
                    case "-f":
                        files = s.Substring(2).Split(breakChars);
                        break;
                    case "/o":
                    case "-o":
                        dir = s.Substring(2);
                        break;
                    case "/p":
                    case "-p":
                        rc._DataSourcePassword = s.Substring(2);
                        break;
                    case "/t":
                    case "-t":
                        types = s.Substring(2).Split(breakChars);
                        break;
                    case "/?":
                    case "-?":
                        WriteHelp();
                        return 0;
                    case "/s":
                    case "-s":
                        rc._ShowStats = true;
                        break;
                    case "/i":
                    case "-i":
                        rc._StampInfo = s.Substring(2);
                        break;
                    case "/u":
                    case "-u":
                        rc._user = s.Substring(2); // Allow the user to be set via a command line param (u) GJL AJM 12062008
                        break;
                    default:
                        Console.WriteLine("Unknown command '{0}' ignored.", s);
                        returnCode = 4;
                        break;
                }
            }
            if (files == null)
            {
                Console.WriteLine("/f parameter is required.");
                return 8;
            }

            if (types == null)
            {
                Console.WriteLine("/t parameter is required.");
                return 8;
            }

            if (dir == null)
            {
                dir = Environment.CurrentDirectory;
            }

            if (dir[dir.Length-1] != Path.DirectorySeparatorChar)
                dir += Path.DirectorySeparatorChar;

            rc.returnCode = returnCode;

            rc.DoRender(dir, files, types);

            return rc.returnCode;
        }