Module: PatchELF::CLI
Overview
For command line interface to parsing arguments.
Constant Summary collapse
- SCRIPT_NAME =
Name of binary.
'patchelf.rb'.freeze
- USAGE =
CLI usage string.
format('Usage: %s <commands> FILENAME [OUTPUT_FILE]', SCRIPT_NAME).freeze
Class Method Summary collapse
-
.work(argv) ⇒ void
Main method of CLI.
Class Method Details
.work(argv) ⇒ void
This method returns an undefined value.
Main method of CLI.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/patchelf/cli.rb', line 27 def work(argv) @options = { set: {}, print: [], needed: [] } return $stdout.puts "PatchELF Version #{PatchELF::VERSION}" if argv.include?('--version') return $stdout.puts option_parser unless parse(argv) # Now the options are (hopefully) valid, let's process the ELF file. begin @patcher = PatchELF::Patcher.new(@options[:in_file]) rescue ELFTools::ELFError, Errno::ENOENT => e return PatchELF::Logger.error(e.) end patcher.use_rpath! if @options[:force_rpath] readonly patch_requests patcher.save(@options[:out_file]) end |