lib/flydata/helpers.rb in flydata-0.2.19 vs lib/flydata/helpers.rb in flydata-0.2.20
- old
+ new
@@ -10,23 +10,28 @@
klass = to_command_class(class_name)
end
[klass, method]
end
- def usage_text
+ def usage_text(err = true)
text = ""
- text += <<-EOM
+
+ if err
+ text += <<-EOM
Fix the issue and try again. If the problem continues, please contact support@flydata.com
EOM
- flydata_log = File.join(FLYDATA_HOME, 'flydata.log')
- if File.exists?(flydata_log)
- text += <<-EOM
+
+ flydata_log = File.join(FLYDATA_HOME, 'flydata.log')
+ if File.exists?(flydata_log)
+ text += <<-EOM
Also check the Agent log.
Log path: #{flydata_log}
EOM
+ end
end
+
text += ""
text += '-' * 64
text += "\n"
text += <<-EOM
Usage: flydata COMMAND
@@ -41,9 +46,13 @@
EOM
text += "\n"
text += '-' * 64
text += "\n"
text
+ end
+
+ def flydata_version
+ IO.read(VERSION_PATH).strip
end
def to_command_class(class_name)
eval("Flydata::Command::#{class_name.camelcase}")
end