Class: WrfForecast::HelpOutput
- Inherits:
-
RubyUtils::BaseHelpOutput
- Object
- RubyUtils::BaseHelpOutput
- WrfForecast::HelpOutput
- Defined in:
- lib/wrf_forecast/help/help_output.rb
Overview
Output class for help text
Class Method Summary collapse
-
.add_one_argument_help_entries ⇒ Object
private
method to specify and add the help entries with help text and one argument.
-
.add_single_help_entries ⇒ Object
private
method to specify and add the help entries with help text only.
-
.add_two_argument_help_entries ⇒ Object
private
method to specify and add the help entries with help text and two arguments.
-
.get_script_name ⇒ Object
private
method to set the name of the script project.
-
.print_configuration_parameter ⇒ Object
private
method to print the available configuration parameter.
-
.print_help_head ⇒ Object
private
method to print the header of the help output.
-
.print_invalid_combinations ⇒ Object
private
method to print the invalid parameter combinations.
Class Method Details
.add_one_argument_help_entries ⇒ Object (private)
method to specify and add the help entries with help text and one argument
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/wrf_forecast/help/help_output.rb', line 22 def self.add_one_argument_help_entries add_single_argument_text(:date, " -d, --date ", " <date>", "; specifies the start_date of the requested forecast") add_single_argument_text(:locale, " -l, --locale ", " <locale>", "; specifies the locale in which the forecast should be printed") add_single_argument_text(:offset, " -o, --offset ", " <offset>", "; specifies how many hours from the forecast should be skipped") add_single_argument_text(:period, " -p, --period ", " <period>", "; specifies the forecast period") add_single_argument_text(:save, " -s, --save ", " <target>", "; specifies the output file where the results are saved") nil end |
.add_single_help_entries ⇒ Object (private)
method to specify and add the help entries with help text only
11 12 13 14 15 16 17 18 19 |
# File 'lib/wrf_forecast/help/help_output.rb', line 11 def self.add_single_help_entries add_simple_text(:aggregate, " -a, --aggregate ", "creates hourly values of the measurands in a json object") add_simple_text(:default, " --default ", "runs the script with date as today at midnight and a 24 h forecast period") add_simple_text(:json, " -j, --json ", "returns the forecast values not as a text but a json object") nil end |
.add_two_argument_help_entries ⇒ Object (private)
method to specify and add the help entries with help text and two arguments
37 38 39 |
# File 'lib/wrf_forecast/help/help_output.rb', line 37 def self.add_two_argument_help_entries nil end |
.get_script_name ⇒ Object (private)
method to set the name of the script project
61 62 63 |
# File 'lib/wrf_forecast/help/help_output.rb', line 61 def self.get_script_name "WRF forecast" end |
.print_configuration_parameter ⇒ Object (private)
method to print the available configuration parameter
56 57 58 |
# File 'lib/wrf_forecast/help/help_output.rb', line 56 def self.print_configuration_parameter nil end |
.print_help_head ⇒ Object (private)
method to print the header of the help output
42 43 44 45 46 47 48 |
# File 'lib/wrf_forecast/help/help_output.rb', line 42 def self.print_help_head puts "script usage:".red + " ruby <script> [parameters] <filename>" puts "help usage :".green + " ruby <script> (-h | --help)" puts "help usage for parameter:".green + " ruby <script> <parameter> (-h | --help)" puts "#{get_script_name} help:".light_yellow end |
.print_invalid_combinations ⇒ Object (private)
method to print the invalid parameter combinations
51 52 53 |
# File 'lib/wrf_forecast/help/help_output.rb', line 51 def self.print_invalid_combinations nil end |