1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-09 13:10:24 +01:00

Add additional verbosity option (#169)

This commit is contained in:
2022-05-07 13:32:45 +02:00
parent 1c15a4e07f
commit c171df0a93
4 changed files with 29 additions and 3 deletions

View File

@@ -91,7 +91,7 @@ public class Shell {
task.launch()
task.waitUntilExit()
return Shell.Output(
let output = Shell.Output(
standardOutput: String(
data: outputPipe.fileHandleForReading.readDataToEndOfFile(),
encoding: .utf8
@@ -102,6 +102,22 @@ public class Shell {
)!,
task: task
)
if CommandLine.arguments.contains("--v") {
Log.info("")
Log.info("==== COMMAND ====")
Log.info("")
Log.info("\(self.shell) \(task.arguments?.joined(separator: " ") ?? "")")
Log.info("")
Log.info("==== OUTPUT ====")
Log.info("")
dump(output)
Log.info("")
Log.info("==== END OUTPUT ====")
Log.info("")
}
return output
}
/**