예제 #1
0
        static bool DockerLogin_required()
        {
            if (Docker.DockerLogin(null, null))
            {
                Console.WriteLine("Login Succeed!, rerun the command!");
                return(true);
            }

            Console.WriteLine("User or Password incorrect");
            return(false);
        }
예제 #2
0
        static bool DockerLogin(string[] args)
        {
            string firstArg = args.Length > 0 ? args[0] : "";

            bool retval = false;

            Parser.Default.ParseArguments <DockerLoginOptions>(args).WithParsed(options => {
                if (Docker.DockerLogin(options.User, options.Password))
                {
                    Console.WriteLine("Succeed!");
                    retval = true;
                }
                else
                {
                    Console.WriteLine("User or Password incorrect");
                }
            });
            return(retval);
        }