1
0
mirror of https://git.baguette.netlib.re/Baguette/networkctl synced 2024-12-19 13:33:23 +00:00
networkctl/src/do.cr

23 lines
476 B
Crystal
Raw Normal View History

2019-10-13 22:42:15 +00:00
class Do < Process
class_property simulation = false
def self.run(cmd : String, params = [] of String)
2019-10-13 22:42:15 +00:00
if @@simulation
puts "simulation, do: #{cmd} #{params.join(" ")}"
Process::Status.new 0
else
Process.run cmd, params
end
end
def self.run(cmd : String, params = [] of String, &block : Process -> _)
2019-10-13 22:42:15 +00:00
if @@simulation
puts "simulation, do: #{cmd} #{params.join(" ")}"
Process::Status.new 0
else
Process.run cmd, params, &block
end
end
end