diff options
Diffstat (limited to 'blatube_v1.0.0.rb')
-rw-r--r-- | blatube_v1.0.0.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/blatube_v1.0.0.rb b/blatube_v1.0.0.rb index 3fbfb00..0ecd5fb 100644 --- a/blatube_v1.0.0.rb +++ b/blatube_v1.0.0.rb @@ -10,7 +10,7 @@ require 'json' @to_station = nil @weight = 'peak_time' @change_time = 5 -@colour = true +@colour = false debug = false help = false ops = nil @@ -28,7 +28,7 @@ options = OptionParser.new do |opts| opts.on( '-t', '--to-station STATION', 'Find route to this station.' ) {|t| @to_station = t } opts.on( '-w', '--weight WEIGHT', 'Shortest route using either distance, peak_time, off_peak_time or unimpeded_time.' ) {|w| @weight = w if WEIGHTS.include? w || 'peak_time' } opts.on( '-c', '--change-time TIME', 'Your expected average change time in minutes.' ) {|c| @change_time = c.to_f.round(2) } - opts.on( '-C', '--no-colour', 'Disable line colours in the output.' ) { @colour = false } + opts.on( '-C', '--colour', 'Enable line colours in the output.' ) { @colour = true } opts.on( '-d', '--debug', 'Display debug info.' ) { debug = true } opts.on( '-v', '--version', 'blatube version number.' ) { puts VERSION; exit } opts.on( '-h', '--help', 'Display this screen.' ) { help = true; ops = opts } @@ -135,10 +135,10 @@ def run_algorithm graph, nodes, start_node end def traverse_route to_station - if @routes[to_station] != -1 - traverse_route @routes[to_station] - end - @shortest_route << to_station + if @routes[to_station] != -1 + traverse_route @routes[to_station] + end + @shortest_route << to_station end #TODO: a nicer way of doing this |