Skip to content

Commit

Permalink
feat: Ensure warning message go to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
pusewicz committed Mar 16, 2024
1 parent e4b2121 commit 8663e2e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/vimpk/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(argv)
@options = @parser.parse
@command = determine_command
rescue OptionParser::MissingArgument, OptionParser::InvalidOption => e
puts e.message
warn e.message
abort "Use --help for usage information"
end

Expand All @@ -38,7 +38,7 @@ def determine_command
when "rm", "remove"
:remove_command
else
puts colorize("Unknown command: #{name}", color: :red)
warn colorize("Unknown command: #{name}", color: :red)
abort "Use --help for usage information"
end
end
Expand All @@ -50,12 +50,12 @@ def install_command(package = nil)
install.call
puts colorize("Installed #{package} to #{install.dest}. Took #{Time.now - time} seconds.", color: :green)
rescue Git::GitError => e
puts colorize("Error: #{e.message}", color: :red)
warn colorize("Error: #{e.message}", color: :red)
abort e.output.lines.map { |line| " #{line}" }.join
rescue Install::PackageExistsError => e
puts colorize("Error: #{e.message}", color: :red)
warn colorize("Error: #{e.message}", color: :red)
rescue ArgumentError => e
puts colorize("Error: #{e.message}", color: :red)
warn colorize("Error: #{e.message}", color: :red)
end

def move_command(name = nil)
Expand Down

0 comments on commit 8663e2e

Please sign in to comment.