Class: HelpOutput
- Inherits:
-
RubyUtils::BaseHelpOutput
- Object
- RubyUtils::BaseHelpOutput
- HelpOutput
- Defined in:
- lib/output/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 default help text.
-
.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
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/output/help_output.rb', line 25 def self.add_one_argument_help_entries add_single_argument_text(:all, ' -a, --all ', ' <speed>', '; prints all specified datasets of a dataseries with a pause ' \ 'between the output of every dataset defined by speed: 0 means ' \ 'manual, a value > 0 an animation speed in seconds, excludes -i,' \ ' -d and -t') add_single_argument_text(:index, ' -i, --index ', ' <index>', '; shows the dataset at index, if index lies within ' \ '[1,2, ..., # datasets], excludes -a, -d and -t') add_single_argument_text(:option, ' -o, --options ', ' <option>', '; enables options, the source depends on the argument: '\ 'file=<filename> loads options from <filename>, menu enables the '\ 'possibility to input the desired values') end |
.add_single_help_entries ⇒ Object (private)
method to specify and add the help entries with help text only
14 15 16 17 18 19 20 21 22 |
# File 'lib/output/help_output.rb', line 14 def self.add_single_help_entries add_simple_text(:extreme, ' -e, --extreme ', 'marks the extreme values in a ' \ 'dataset with ++ for a maximum and -- for a minimum, ' \ 'also prints the coordinates of the extreme values below' \ ' the legend, excludes -c') add_simple_text(:meta, ' -m, --meta ', 'process the file <filename> ' \ 'containing meta data') end |
.add_two_argument_help_entries ⇒ Object (private)
method to specify and add the help entries with help text and two arguments
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/output/help_output.rb', line 41 def self.add_two_argument_help_entries add_dual_argument_text(:coord, ' -c, --coord ', ' <x> <y>', '; interpolates the data for the given coordinate (x,y) ' \ 'with default dataset index 0, excludes -e, -a, -r and -t') add_dual_argument_text(:delta, ' -d, --delta ', ' <first_index> <second_index>', '; subtracts the first dataset from the second dataset and ' \ 'visualizes the difference, indices as [1,2, ..., # ' \ 'datasets], excludes -a, -i and -t') add_dual_argument_text(:range, ' -r, --range ', ' <start> <end>', '; prints all datasets within the range of the provided ' \ 'arguments, indices as [1,2, ..., # datasets], excludes -i, -t') add_dual_argument_text(:section, ' -s, --section ', ' <interval> <delta>', '; interpolates data for a given region, ' \ 'specified by a coordinate, an interval and stepwidth; result: ' \ 'interpolated values in (x+-interval, y+-interval) with stepwidth ' \ 'delta, excludes -a, -r and -t; requires -c') add_dual_argument_text(:time, ' -t, --time ', ' <x> <y>', '; creates a timeline for the given coordinate (x,y), coordinates ' \ 'not laying on the data point will be interpolated, excludes -a,' \ ' -c, and -i') end |
.get_script_name ⇒ Object (private)
method to set the name of the script project
92 93 94 |
# File 'lib/output/help_output.rb', line 92 def self.get_script_name "TerminalVis" end |
.print_configuration_parameter ⇒ Object (private)
method to print the available configuration parameter
83 84 85 86 87 88 89 |
# File 'lib/output/help_output.rb', line 83 def self.print_configuration_parameter puts "\nAvailable configuration parameter:".red puts 'Timeline:'.blue + ' number of interval steps in y-dimension [5,100]' puts 'Color legend:'.blue + ' extended informations about the intervals' puts 'Scaling:'.blue + ' automatic scaling of the output to the size of ' \ 'the calling terminal (atm standard dataset output, e.g. -i only)' end |
.print_help_head ⇒ Object (private)
method to print the default help text
65 66 67 68 69 70 71 |
# File 'lib/output/help_output.rb', line 65 def self.print_help_head puts 'script usage:'.red + " ruby <script> [parameters] (-f | --file) <filename>" puts 'help usage :'.green + " ruby <script> (-h | --help)" puts 'help usage for parameter:'.green + " ruby <script> <parameter> (-h | --help)" puts "\n#{get_script_name} help:".light_yellow end |
.print_invalid_combinations ⇒ Object (private)
method to print the invalid parameter combinations
74 75 76 77 78 79 80 |
# File 'lib/output/help_output.rb', line 74 def self.print_invalid_combinations puts "\nInvalid parameter combinations:".red puts ' -a + -d, -a + -i, -a + -t' puts ' -r + -t, -r + -i' puts ' -c + -e, -c + -t' puts ' -d + -i, -d + -t' end |