Method: Wordlist::Compression::Writer.command
- Defined in:
- lib/wordlist/compression/writer.rb
.command(path, format:, append: false) ⇒ String
Returns the command to write to the compressed wordlist.
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/wordlist/compression/writer.rb', line 39 def self.command(path, format: , append: false) command = COMMANDS.fetch(format) do raise(UnknownFormat,"unsupported format: #{format.inspect}") end redirect = if append then '>>' else '>' end return "#{Shellwords.shellescape(command)} #{redirect} #{Shellwords.shellescape(path)}" end |