exe/livdoc in living_document-1.0.0 vs exe/livdoc in living_document-1.1.0
- old
+ new
@@ -1,11 +1,19 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'listen'
+require 'optparse'
require_relative '../lib/living_document.rb'
+
+parser = OptionParser.new
+parser.on('-v', '--version', 'Print the version') do
+ puts(LivingDocument::VERSION)
+ exit(0)
+end
+parser.parse!
# rubocop:disable Style/TopLevelMethodDefinition
def evaluate_code_and_update_source_file(file_path)
puts('Running code...')
code_in_file = File.read(file_path)