private static int Main(string[] args)
        {
            IntegrationManager integrationManager = new IntegrationManager();

            if (args.Length != 2)
            {
                return(ShowUsage());
            }

            switch (args[0].ToLower())
            {
            case ArgCreateDefect:
                return(integrationManager.CreateDefect(args[1]));

            case ArgOpenDefect:
                return(integrationManager.OpenDefect(args[1]));

            case ArgGetStatesDefect:
                return(integrationManager.GetStatesForDefects(args[1]));

            case ArgGetDefectIdInfo:
                return(integrationManager.GetInfosForDefects(args[1]));

            default:
                return(ShowUsage());
            }
        }
Beispiel #2
0
        static int Main(string[] args)
        {
            IntegrationManager integrationManager = new IntegrationManager();

            for (int i = 0; i < args.Length; i++)
            {
                switch (args[i].ToLower())
                {
                case ArgCreateDefect:
                    if (i + 1 < args.Length)
                    {
                        i++;
                        return(integrationManager.CreateDefect(args[i]));
                    }
                    else
                    {
                        return(ShowUsage());
                    }

                case ArgOpenDefect:
                    if (i + 1 < args.Length)
                    {
                        i++;
                        return(integrationManager.OpenDefect(args[i]));
                    }
                    else
                    {
                        return(ShowUsage());
                    }

                case ArgGetStatesDefect:
                    if (i + 1 < args.Length)
                    {
                        i++;
                        return(integrationManager.GetStatesForDefects(args[i]));
                    }
                    else
                    {
                        return(ShowUsage());
                    }

                case ArgGetDefectIdInfo:
                    if (i + 1 < args.Length)
                    {
                        i++;
                        return(integrationManager.GetInfosForDefects(args[i]));
                    }
                    else
                    {
                        return(ShowUsage());
                    }

                default:
                    return(ShowUsage());
                }
            }

            return(ShowUsage());
        }
        private static int Main( string[] args ) {
            IntegrationManager integrationManager = new IntegrationManager();

            if (args.Length != 2) {
                return ShowUsage();
            }

            switch (args[0].ToLower()) {
                case ArgCreateDefect:
                    return integrationManager.CreateDefect(args[1]);
                case ArgOpenDefect:
                    return integrationManager.OpenDefect(args[1]);
                case ArgGetStatesDefect:
                    return integrationManager.GetStatesForDefects(args[1]);
                case ArgGetDefectIdInfo:
                    return integrationManager.GetInfosForDefects(args[1]);
                default:
                    return ShowUsage();
            }
        }