Пример #1
0
        private static async Task <string> GetProfileName()
        {
            var profiles = await JiraProfileService.GetAvailableProfiles();

            var inputSelect = InputSelection
                              .From <string>("Select a profile to delete")
                              .AddOption(profiles);

            return((await inputSelect.RequestInput()).FirstOrDefault());
        }
Пример #2
0
        /// <summary>
        /// Print all available profiles
        /// </summary>
        /// <returns></returns>
        private static async Task ListProfiles()
        {
            var defaultProfile = await JiraProfileService.GetDefaultProfileName();

            foreach (var p in await JiraProfileService.GetAvailableProfiles())
            {
                string isDefault() => defaultProfile == p ? " * " : "";

                Console.WriteLine(" -> " + p + isDefault());
            }
        }
Пример #3
0
        private static async Task CreateNewProfile()
        {
            var count   = (await JiraProfileService.GetAvailableProfiles()).Count();
            var profile = await ConsoleI.RenderForm <TerminalJiraProfile>();

            var isDefault = ConsoleI.AskConfirmation("Set as default profile");

            var service = await JiraProfileService.Create(profile, "");

            Console.WriteLine("Created profile " + profile.ProfileName);

            if (count == 0 || isDefault)
            {
                await service.SetAsDefault();

                Console.WriteLine("Profile set as default");
            }
        }
Пример #4
0
 private static async Task <bool> CheckHasProfiles()
 {
     return((await JiraProfileService.GetAvailableProfiles())
            .Count() > 0);
 }