From c0537c991a09293fd7cc2f4ed012032c115c98f5 Mon Sep 17 00:00:00 2001 From: Fulgurance Date: Sat, 4 Jan 2025 18:44:49 +0000 Subject: [PATCH] Removed underline --- ISM/CommandLine.cr | 4 +-- ISM/Default/Option/System/System.cr | 19 +++++++++++++ ISM/Option/System/System.cr | 41 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 ISM/Default/Option/System/System.cr create mode 100644 ISM/Option/System/System.cr diff --git a/ISM/CommandLine.cr b/ISM/CommandLine.cr index dbb59c07..387df3f4 100644 --- a/ISM/CommandLine.cr +++ b/ISM/CommandLine.cr @@ -1712,7 +1712,7 @@ module ISM puts "#{summaryText.colorize(:green)}" - print "#{ISM::Default::CommandLine::InstallQuestion.colorize.mode(:underline)}" + + print "#{ISM::Default::CommandLine::InstallQuestion}" + "[" + "#{ISM::Default::CommandLine::YesReplyOption.colorize(:green)}" + "/" + "#{ISM::Default::CommandLine::NoReplyOption.colorize(:red)}" + "]" @@ -1726,7 +1726,7 @@ module ISM puts "#{summaryText.colorize(:green)}" - print "#{ISM::Default::CommandLine::UninstallQuestion.colorize.mode(:underline)}" + + print "#{ISM::Default::CommandLine::UninstallQuestion.colorize}" + "[" + "#{ISM::Default::CommandLine::YesReplyOption.colorize(:green)}" + "/" + "#{ISM::Default::CommandLine::NoReplyOption.colorize(:red)}" + "]" diff --git a/ISM/Default/Option/System/System.cr b/ISM/Default/Option/System/System.cr new file mode 100644 index 00000000..a465b1c6 --- /dev/null +++ b/ISM/Default/Option/System/System.cr @@ -0,0 +1,19 @@ +module ISM + + module Default + + module Option + + module Port + + ShortText = "-sy" + LongText = "system" + Description = "Manage the system" + Options = [] + + end + end + + end + +end diff --git a/ISM/Option/System/System.cr b/ISM/Option/System/System.cr new file mode 100644 index 00000000..ce74d153 --- /dev/null +++ b/ISM/Option/System/System.cr @@ -0,0 +1,41 @@ +module ISM + + module Option + + class System < ISM::CommandLineOption + + def initialize + super( ISM::Default::Option::System::ShortText, + ISM::Default::Option::System::LongText, + ISM::Default::Option::System::Description, + ISM::Default::Option::System::Options) + end + + def start + if ARGV.size == 1 + showHelp + else + matchingOption = false + + @options.each_with_index do |argument, index| + if ARGV[1] == argument.shortText || ARGV[1] == argument.longText + matchingOption = true + @options[index].start + break + end + end + + if !matchingOption + puts "#{ISM::Default::CommandLine::ErrorUnknowArgument.colorize(:yellow)}" + "#{ARGV[0].colorize(:white)}" + puts "#{ISM::Default::CommandLine::ErrorUnknowArgumentHelp1.colorize(:white)}" + + "#{ISM::Default::CommandLine::ErrorUnknowArgumentHelp2.colorize(:green)}" + + "#{ISM::Default::CommandLine::ErrorUnknowArgumentHelp3.colorize(:white)}" + end + end + end + + end + + end + +end