From ab6e28417a9195fe03b8355a808a81276d0435ff Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Tue, 3 Mar 2020 14:25:32 +0000 Subject: Added command line config --- lib/longboat/config.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/longboat/config.rb (limited to 'lib/longboat/config.rb') diff --git a/lib/longboat/config.rb b/lib/longboat/config.rb new file mode 100644 index 0000000..874a5be --- /dev/null +++ b/lib/longboat/config.rb @@ -0,0 +1,16 @@ +require 'optimist' + +module Longboat + module Config + def self.parse! + Optimist::options do + # Collection interval + opt :collect_every, "Collection interval", type: Integer, default: 60 + + # Sinatra server + opt :server_bind, "Server listening address", type: String, default: "127.0.0.1:8564" + opt :server_path, "Path to metrics", type: String, default: "/metrics" + end + end + end +end -- cgit v1.2.1