From 8805cb154e16f51bdd6a0c7c0e9334433343be8a Mon Sep 17 00:00:00 2001 From: Tim Tilberg Date: Thu, 12 Dec 2019 11:07:05 -0600 Subject: [PATCH] Clarify options and warn about overwriting This might help new users select the desired operation, and make it known that some operations are potentially dangerous. - Change `[identifier]` to `[schedule]` - Add note about overwriting existing crontab --- bin/whenever | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/whenever b/bin/whenever index cdc97a27..b6c7437e 100755 --- a/bin/whenever +++ b/bin/whenever @@ -8,15 +8,21 @@ options = {} OptionParser.new do |opts| opts.banner = "Usage: whenever [options]" - opts.on('-i', '--update-crontab [identifier]', 'Default: full path to schedule.rb file') do |identifier| + opts.on('-i', '--update-crontab [schedule]', + 'Install the schedule to crontab.', + ' Default: full path to schedule.rb file') do |identifier| options[:update] = true options[:identifier] = identifier if identifier end - opts.on('-w', '--write-crontab [identifier]', 'Default: full path to schedule.rb file') do |identifier| + opts.on('-w', '--write-crontab [schedule]', + 'Clear current crontab, and overwrite it with only the given schedule.', + ' Default: full path to schedule.rb file') do |identifier| options[:write] = true options[:identifier] = identifier if identifier end - opts.on('-c', '--clear-crontab [identifier]') do |identifier| + opts.on('-c', '--clear-crontab [schedule]', + 'Uninstall the schedule from crontab.', + ' Default: full path to schedule.rb file') do |identifier| options[:clear] = true options[:identifier] = identifier if identifier end