Skip to content

Commit

Permalink
fix: error handling for invalid option
Browse files Browse the repository at this point in the history
  • Loading branch information
iberianpig committed Sep 26, 2024
1 parent c3897f2 commit 3cf707d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exe/fusuma-sendkey
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ opt.on('--version', 'Show version') do |v|
option[:version] = v
end

opt.parse!(ARGV)
begin
opt.parse!(ARGV)
rescue OptionParser::InvalidOption => e
warn e
warn opt.help
exit 1
end

device_name = Fusuma::Config.instance.fetch_config_params(
:device_name,
Expand Down

0 comments on commit 3cf707d

Please sign in to comment.