Skip to content
Snippets Groups Projects
Commit 2ddbac8f authored by Michal Svamberg's avatar Michal Svamberg
Browse files

Funcni volba --dry-run

parent 2a1c712e
No related branches found
No related tags found
No related merge requests found
Pipeline #4078 passed
...@@ -15,10 +15,14 @@ Future<void> main(List<String> args) async { ...@@ -15,10 +15,14 @@ Future<void> main(List<String> args) async {
//print("===BEST COMMAND FOR EXECUTING==="); //print("===BEST COMMAND FOR EXECUTING===");
//stderr.write(tmp); //stderr.write(tmp);
if (opt.isDryRun()) {
print(tmp);
} else {
var result = await Process.run('bash', ['-c', tmp]); var result = await Process.run('bash', ['-c', tmp]);
stdout.write(result.stdout); stdout.write(result.stdout);
stderr.write(result.stderr); stderr.write(result.stderr);
}
/** /**
Location src2 = Location("svamberg@zcu.cz:/tmp/x/y.z"); Location src2 = Location("svamberg@zcu.cz:/tmp/x/y.z");
......
...@@ -120,4 +120,8 @@ class Options { ...@@ -120,4 +120,8 @@ class Options {
return (_results['P'] == null) ? false : true; return (_results['P'] == null) ? false : true;
} }
bool isDryRun() {
return (_results['dry-run'] == true) ? true : false;
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment