Created
June 28, 2016 20:40
-
-
Save maxpowa/1140d8820afdf5a4c2bd0ff06ffd31ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "../flag.cr" | |
class ExecuteFlag < Blerp::CommandFlag | |
def name | |
:execute | |
end | |
def key | |
"-e" | |
end | |
def description | |
"EXECUTE SOMETHING" | |
end | |
def processor (parser, data) | |
command = data.has_key?(:opposite) ? "nothing" : "something" | |
output = MemoryIO.new | |
Process.run(command, shell: true, output: output, error: output) | |
output.close | |
data[:output].as(Array(String)) << output.to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment