diff --git a/UnicodePlot.html b/UnicodePlot.html index ac00c47..15d58a7 100644 --- a/UnicodePlot.html +++ b/UnicodePlot.html @@ -241,7 +241,7 @@ diff --git a/YouPlot.html b/YouPlot.html index d0ceeed..8087b5e 100644 --- a/YouPlot.html +++ b/YouPlot.html @@ -296,7 +296,7 @@ diff --git a/YouPlot/Backends.html b/YouPlot/Backends.html index 4bea60a..bd9ad3b 100644 --- a/YouPlot/Backends.html +++ b/YouPlot/Backends.html @@ -118,7 +118,7 @@ diff --git a/YouPlot/Backends/Processing.html b/YouPlot/Backends/Processing.html index f7d9074..edcd352 100644 --- a/YouPlot/Backends/Processing.html +++ b/YouPlot/Backends/Processing.html @@ -208,7 +208,7 @@ diff --git a/YouPlot/Backends/UnicodePlot.html b/YouPlot/Backends/UnicodePlot.html index eccc3eb..6606bab 100644 --- a/YouPlot/Backends/UnicodePlot.html +++ b/YouPlot/Backends/UnicodePlot.html @@ -1070,7 +1070,7 @@ diff --git a/YouPlot/Backends/UnicodePlot/Error.html b/YouPlot/Backends/UnicodePlot/Error.html index ba257ea..21a8df4 100644 --- a/YouPlot/Backends/UnicodePlot/Error.html +++ b/YouPlot/Backends/UnicodePlot/Error.html @@ -114,7 +114,7 @@ diff --git a/YouPlot/Command.html b/YouPlot/Command.html index e5f9279..a7103a3 100644 --- a/YouPlot/Command.html +++ b/YouPlot/Command.html @@ -767,7 +767,7 @@ diff --git a/YouPlot/DSV.html b/YouPlot/DSV.html index dfa47da..968d05d 100644 --- a/YouPlot/DSV.html +++ b/YouPlot/DSV.html @@ -460,7 +460,7 @@ diff --git a/YouPlot/Data.html b/YouPlot/Data.html index 1ef0453..e89f238 100644 --- a/YouPlot/Data.html +++ b/YouPlot/Data.html @@ -300,7 +300,7 @@ diff --git a/YouPlot/Options.html b/YouPlot/Options.html index e22ea30..078ec24 100644 --- a/YouPlot/Options.html +++ b/YouPlot/Options.html @@ -1103,7 +1103,7 @@ diff --git a/YouPlot/Parameters.html b/YouPlot/Parameters.html index f5b4aa1..b641701 100644 --- a/YouPlot/Parameters.html +++ b/YouPlot/Parameters.html @@ -1881,7 +1881,7 @@ diff --git a/YouPlot/Parser.html b/YouPlot/Parser.html index 9a7277c..b8ce9db 100644 --- a/YouPlot/Parser.html +++ b/YouPlot/Parser.html @@ -836,9 +836,7 @@ 29 30 31 -32 -33 -34 +32
# File 'lib/youplot/parser.rb', line 15
@@ -860,8 +858,6 @@
   )
 
   @params = Parameters.new
-
-  apply_config_file
 end
@@ -1196,18 +1192,18 @@
 
 
+34
+35
 36
 37
 38
-39
-40
-41
+39 -
# File 'lib/youplot/parser.rb', line 36
+      
# File 'lib/youplot/parser.rb', line 34
 
 def apply_config_file
-  return unless find_config_file
+  return if !config_file && find_config_file.nil?
 
   read_config_file
   configure
@@ -1232,6 +1228,8 @@
       
 
 
+41
+42
 43
 44
 45
@@ -1243,12 +1241,10 @@
 51
 52
 53
-54
-55
-56
+54
-
# File 'lib/youplot/parser.rb', line 43
+      
# File 'lib/youplot/parser.rb', line 41
 
 def config_file_candidate_paths
   # keep the order of the paths
@@ -1284,6 +1280,8 @@
       
 
 
+73
+74
 75
 76
 77
@@ -1296,12 +1294,10 @@
 84
 85
 86
-87
-88
-89
+87
-
# File 'lib/youplot/parser.rb', line 75
+      
# File 'lib/youplot/parser.rb', line 73
 
 def configure
   option_members = @options.members
@@ -1310,9 +1306,9 @@
   config.each do |k, v|
     k = k.to_sym
     if option_members.include?(k)
-      @options[k] = v
+      @options[k] ||= v
     elsif param_members.include?(k)
-      @params[k] = v
+      @params[k] ||= v
     else
       raise Error, "Unknown option/param: #{k}"
     end
@@ -1338,6 +1334,8 @@
       
 
 
+89
+90
 91
 92
 93
@@ -1417,10 +1415,11 @@
 167
 168
 169
-170
+170 +171
-
# File 'lib/youplot/parser.rb', line 91
+      
# File 'lib/youplot/parser.rb', line 89
 
 def create_base_parser
   OptionParser.new do |parser|
@@ -1496,6 +1495,9 @@
       puts parser.help
       exit if YouPlot.run_as_executable?
     end
+    parser.on('--config FILE', 'specify a config file') do |v|
+      @config_file = v
+    end
     parser.on('--debug', TrueClass, 'print preprocessed data') do |v|
       options[:debug] = v
     end
@@ -1522,7 +1524,6 @@
       
 
 
-172
 173
 174
 175
@@ -1560,10 +1561,11 @@
 207
 208
 209
-210
+210 +211
-
# File 'lib/youplot/parser.rb', line 172
+      
# File 'lib/youplot/parser.rb', line 173
 
 def create_main_parser
   @main_parser = create_base_parser
@@ -1624,7 +1626,6 @@
       
 
 
-290
 291
 292
 293
@@ -1713,10 +1714,11 @@
 376
 377
 378
-379
+379 +380
-
# File 'lib/youplot/parser.rb', line 290
+      
# File 'lib/youplot/parser.rb', line 291
 
 def create_sub_parser
   @sub_parser = create_base_parser
@@ -1828,6 +1830,8 @@
       
 
 
+56
+57
 58
 59
 60
@@ -1836,12 +1840,10 @@
 63
 64
 65
-66
-67
-68
+66
-
# File 'lib/youplot/parser.rb', line 58
+      
# File 'lib/youplot/parser.rb', line 56
 
 def find_config_file
   config_file_candidate_paths.each do |file|
@@ -1874,7 +1876,6 @@
       
 
 
-381
 382
 383
 384
@@ -1890,10 +1891,13 @@
 394
 395
 396
-397
+397 +398 +399 +400
-
# File 'lib/youplot/parser.rb', line 381
+      
# File 'lib/youplot/parser.rb', line 382
 
 def parse_options(argv = ARGV)
   begin
@@ -1911,6 +1915,8 @@
     warn "uplot: #{e.message}"
     exit 1 if YouPlot.run_as_executable?
   end
+
+  apply_config_file
 end
@@ -1932,13 +1938,13 @@
 
 
+68
+69
 70
-71
-72
-73
+71
-
# File 'lib/youplot/parser.rb', line 70
+      
# File 'lib/youplot/parser.rb', line 68
 
 def read_config_file
   require 'yaml'
@@ -1964,7 +1970,6 @@
       
 
 
-218
 219
 220
 221
@@ -1980,10 +1985,11 @@
 231
 232
 233
-234
+234 +235
-
# File 'lib/youplot/parser.rb', line 218
+      
# File 'lib/youplot/parser.rb', line 219
 
 def show_config_info
   if ENV['MYYOUPLOTRC']
@@ -2022,14 +2028,14 @@
       
 
 
-212
 213
 214
 215
-216
+216 +217
-
# File 'lib/youplot/parser.rb', line 212
+      
# File 'lib/youplot/parser.rb', line 213
 
 def show_main_help(out = $stdout)
   out.puts main_parser.banner
@@ -2056,15 +2062,15 @@
       
 
 
-249
 250
 251
 252
 253
-254
+254 +255
-
# File 'lib/youplot/parser.rb', line 249
+      
# File 'lib/youplot/parser.rb', line 250
 
 def sub_parser_add_canvas
   canvas_types = UnicodePlot::Canvas::CANVAS_CLASS_MAP.keys.join(', ')
@@ -2092,16 +2098,16 @@
       
 
 
-274
 275
 276
 277
 278
 279
-280
+280 +281
-
# File 'lib/youplot/parser.rb', line 274
+      
# File 'lib/youplot/parser.rb', line 275
 
 def sub_parser_add_fmt_xyxy
   sub_parser.on_head('--fmt STR', String,
@@ -2130,16 +2136,16 @@
       
 
 
-282
 283
 284
 285
 286
 287
-288
+288 +289
-
# File 'lib/youplot/parser.rb', line 282
+      
# File 'lib/youplot/parser.rb', line 283
 
 def sub_parser_add_fmt_yx
   sub_parser.on_head('--fmt STR', String,
@@ -2168,14 +2174,14 @@
       
 
 
-268
 269
 270
 271
-272
+272 +273
-
# File 'lib/youplot/parser.rb', line 268
+      
# File 'lib/youplot/parser.rb', line 269
 
 def sub_parser_add_grid
   sub_parser.on_head('--[no-]grid', TrueClass, 'draws grid-lines at the origin') do |v|
@@ -2202,14 +2208,14 @@
       
 
 
-236
 237
 238
 239
-240
+240 +241
-
# File 'lib/youplot/parser.rb', line 236
+      
# File 'lib/youplot/parser.rb', line 237
 
 def sub_parser_add_symbol
   sub_parser.on_head('--symbol STR', String, 'character to be used to plot the bars') do |v|
@@ -2236,14 +2242,14 @@
       
 
 
-256
 257
 258
 259
-260
+260 +261
-
# File 'lib/youplot/parser.rb', line 256
+      
# File 'lib/youplot/parser.rb', line 257
 
 def sub_parser_add_xlim
   sub_parser.on_head('--xlim FLOAT,FLOAT', Array, 'plotting range for the x coordinate') do |v|
@@ -2270,15 +2276,15 @@
       
 
 
-242
 243
 244
 245
 246
-247
+247 +248
-
# File 'lib/youplot/parser.rb', line 242
+      
# File 'lib/youplot/parser.rb', line 243
 
 def sub_parser_add_xscale
   xscale_options = UnicodePlot::ValueTransformer::PREDEFINED_TRANSFORM_FUNCTIONS.keys.join(', ')
@@ -2306,14 +2312,14 @@
       
 
 
-262
 263
 264
 265
-266
+266 +267
-
# File 'lib/youplot/parser.rb', line 262
+      
# File 'lib/youplot/parser.rb', line 263
 
 def sub_parser_add_ylim
   sub_parser.on_head('--ylim FLOAT,FLOAT', Array, 'plotting range for the y coordinate') do |v|
@@ -2330,7 +2336,7 @@
 
 
       
diff --git a/YouPlot/Parser/Error.html b/YouPlot/Parser/Error.html
index 028e06d..275df66 100644
--- a/YouPlot/Parser/Error.html
+++ b/YouPlot/Parser/Error.html
@@ -114,7 +114,7 @@
 
 
       
diff --git a/_index.html b/_index.html
index 154c24c..ee95f83 100644
--- a/_index.html
+++ b/_index.html
@@ -238,7 +238,7 @@
 
 
       
diff --git a/file.README.html b/file.README.html
index cb352f6..1756636 100644
--- a/file.README.html
+++ b/file.README.html
@@ -404,7 +404,7 @@ If so, please feel free to contact us.
 
 
       
diff --git a/index.html b/index.html
index 9891ec1..fa4ad52 100644
--- a/index.html
+++ b/index.html
@@ -404,7 +404,7 @@ If so, please feel free to contact us.
 
 
       
diff --git a/top-level-namespace.html b/top-level-namespace.html
index e862034..f333941 100644
--- a/top-level-namespace.html
+++ b/top-level-namespace.html
@@ -100,7 +100,7 @@