#!/usr/bin/env ruby require 'gli' include GLI::App subcommand_option_handling :normal sort_help :manually commands_from 'flapjack/cli' program_desc 'Flexible monitoring notification routing system' version Flapjack::VERSION desc 'Configuration file to use' default_value '/etc/flapjack/flapjack.yaml' arg_name '/path/to/flapjack.yaml' flag [:c,:config] desc 'Environment to boot' default_value 'production' arg_name '' flag [:n, :env, :environment] accept Array do |value| value.split(/,/).map(&:strip) end pre do |global,command,options,args| FLAPJACK_ENV = ENV["FLAPJACK_ENV"] || global[:environment] true end post do |global,command,options,args| end on_error do |exception| true end exit run(ARGV)