Class: Commiter::CommiterCli
- Inherits:
-
Object
- Object
- Commiter::CommiterCli
- Defined in:
- lib/commiter.rb
Class Method Summary collapse
- .print_help_messages(should_exit) ⇒ Object
- .start_cli ⇒ Object
- .validate_command_args(option, should_show_debug_messages) ⇒ Object
Class Method Details
.print_help_messages(should_exit) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/commiter.rb', line 9 def self.(should_exit) puts "Command [-q] Generate Quick Git Messages Rules" puts "Command [-g] Generate Git Rules Based On Questions" puts "Command [-c] Generate Config File Without Change Git Rules" puts "Command [-d] Show Debug Messages While Generating Git Config" puts "Command [-r] Restore Git Rules Based On Config File" if should_exit exit end end |
.start_cli ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/commiter.rb', line 54 def self.start_cli cliParameters = ARGV = false puts "########################### - Commiter Cli Starter -#################################" puts "Welcome To Commiter Version : #{Commiter::VERSION}" puts "This CLI Will Change Your Git Settings Commit Messages" puts "#####################################################################################" puts "" # Find Debug Option cliParameters.each do |item| if item == "-d" = true end end if puts "Commiter Arguments Validation Started ... With Input : #{cliParameters}" end # Start Validate CLI Params cliParameters.each do |item| self.validate_command_args(item, ) end puts "" # Start Generate If -g Found cliParameters.each do |item| if item == "-g" if puts "Command [-g] Found Will Start The Generator ..." end CommiterGenerator::CommiterCliGenerator::start end end end |
.validate_command_args(option, should_show_debug_messages) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/commiter.rb', line 20 def self.validate_command_args(option, ) case option when "-h" (true) when "-help" (true) when "--help" (true) when "-debug" @options[:verbose] = true when "-c" @options[:syntax_highlighting] = true when "-g" if puts "Command [-g] Accepted Will Start Asking Questions Before Update Git Rules" end when "-q" if puts "Command [-q] Accepted Generate Quick Git Messages Rules" end when "-c" if puts "Command [-c] Accepted Generate Config File" end when "-d" if puts "Command [-d] Accepted Will Show Debug Messages" end else puts "Command : [#{option} Rejected Use Cli -h To See The Supported Commands]" end end |