Skip to content

Commit

Permalink
Clarify options and warn about overwriting
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ttilberg authored Dec 12, 2019
1 parent b205bcd commit 8805cb1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bin/whenever
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8805cb1

Please sign in to comment.