diff --git a/lib/ronin/cli/commands/unquote.rb b/lib/ronin/cli/commands/unquote.rb index e0831b8df..e9b068bf6 100644 --- a/lib/ronin/cli/commands/unquote.rb +++ b/lib/ronin/cli/commands/unquote.rb @@ -39,6 +39,7 @@ module Commands # -j, --js Unquotes the JavaScript String # -S, --shell Unquotes the Shell String # -P, --powershell Unquotes the PowerShell String + # --python Unquotes the PowerShell String # -R, --ruby Unquotes the Ruby String # -h, --help Print help information # @@ -78,6 +79,11 @@ class Unquote < StringMethodsCommand @method_calls << :powershell_unquote end + option :python, desc: 'Unquotes the PowerShell String' do + require 'ronin/support/encoding/python' + @method_calls << :python_unquote + end + option :ruby, short: '-R', desc: 'Unquotes the Ruby String' do require 'ronin/support/encoding/ruby' diff --git a/man/ronin-unquote.1.md b/man/ronin-unquote.1.md index 5aa5c76c7..c3ee9fc13 100644 --- a/man/ronin-unquote.1.md +++ b/man/ronin-unquote.1.md @@ -47,6 +47,9 @@ Unquotes a double/single quoted string. `-P`, `--powershell` : Unquotes the PowerShell String. +`--python` +: Unquotes the Python String. + `-R`, `--ruby` : Unquotes the Ruby String. diff --git a/spec/cli/commands/unquote_spec.rb b/spec/cli/commands/unquote_spec.rb index 8f4ca131a..5b78ffd0f 100644 --- a/spec/cli/commands/unquote_spec.rb +++ b/spec/cli/commands/unquote_spec.rb @@ -68,6 +68,18 @@ end end + describe "--python" do + let(:argv) { %w[--python] } + + it "must require 'ronin/support/encoding/python'" do + expect(require('ronin/support/encoding/python')).to be(false) + end + + it "must add :python_unquote to #method_calls" do + expect(subject.method_calls.last).to eq(:python_unquote) + end + end + describe "--ruby" do let(:argv) { %w[--ruby] }