#!/usr/bin/env ruby require 'readline' require 'English' require 'slop' ENV['RACK_ENV'] ||= 'production' # display name for tools like `ps` $PROGRAM_NAME = 'neurohmmerapp' begin Slop.parse!(strict: true, help: true) do banner < e puts e exit! rescue NeuroHmmerApp::BIN_DIR_NOT_FOUND => e puts e unless bin? puts 'You can set the correct value by running:' puts puts ' neurohmmerapp -s -b ' puts end exit! rescue NeuroHmmerApp::NUM_THREADS_INCORRECT => e puts e unless num_threads? puts 'You can set the correct value by running:' puts puts ' neurohmmerapp -s -n ' puts end exit! rescue => e # This will catch any unhandled error and some very special errors. # Ideally we will never hit this block. If we do, there's a bug in # NeuroHmmerApp or something really weird going on. If we hit this # error block we show the stacktrace to the user requesting them to # post the same to our Google Group. puts < e puts e puts "Run '#{$PROGRAM_NAME} -h' for help with command line options." exit end