Fix order of operations, rename output flag
This commit is contained in:
parent
e7726f10d2
commit
317d6930f9
1 changed files with 9 additions and 6 deletions
|
@ -16,7 +16,7 @@ import 'package:libac_dart/consts.dart';
|
||||||
import 'package:libac_dart/utils/IOTools.dart';
|
import 'package:libac_dart/utils/IOTools.dart';
|
||||||
|
|
||||||
Future<int> main(List<String> args) async {
|
Future<int> main(List<String> args) async {
|
||||||
String VERSION = "1.0.082424.0713";
|
String VERSION = "1.0.082424.0715";
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
String HEADER =
|
String HEADER =
|
||||||
"Make File System Report\nVersion: $VERSION\nUsing LibAC Version: ${Constants.VERSION}\nAuthor: Tara Piccari\n\n";
|
"Make File System Report\nVersion: $VERSION\nUsing LibAC Version: ${Constants.VERSION}\nAuthor: Tara Piccari\n\n";
|
||||||
|
@ -32,7 +32,7 @@ Future<int> main(List<String> args) async {
|
||||||
.withArgument(
|
.withArgument(
|
||||||
BoolArgument(name: "help", description: "Hey look! It's me!"))
|
BoolArgument(name: "help", description: "Hey look! It's me!"))
|
||||||
.withArgument(StringArgument(
|
.withArgument(StringArgument(
|
||||||
name: "o",
|
name: "out",
|
||||||
value: "file.html",
|
value: "file.html",
|
||||||
description:
|
description:
|
||||||
"Where to place the report. If not specified, stdout is used"))
|
"Where to place the report. If not specified, stdout is used"))
|
||||||
|
@ -44,9 +44,12 @@ Future<int> main(List<String> args) async {
|
||||||
if (parsed.count == 0 || !parsed.hasArg("path") || parsed.hasArg("help")) {
|
if (parsed.count == 0 || !parsed.hasArg("path") || parsed.hasArg("help")) {
|
||||||
print(helpTest);
|
print(helpTest);
|
||||||
return 0;
|
return 0;
|
||||||
} else
|
} else {
|
||||||
verbose = true;
|
if (parsed.hasArg("out"))
|
||||||
|
verbose = true;
|
||||||
|
else
|
||||||
|
verbose = false;
|
||||||
|
}
|
||||||
print(HEADER);
|
print(HEADER);
|
||||||
|
|
||||||
bool ascending = false;
|
bool ascending = false;
|
||||||
|
@ -64,7 +67,7 @@ Future<int> main(List<String> args) async {
|
||||||
await generateHTMLReport(FIC, ascending: ascending, VERSION: VERSION);
|
await generateHTMLReport(FIC, ascending: ascending, VERSION: VERSION);
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
StringArgument outputPath = parsed.getArg("o") as StringArgument;
|
StringArgument outputPath = parsed.getArg("out") as StringArgument;
|
||||||
prnt("\n> Saving report...");
|
prnt("\n> Saving report...");
|
||||||
await File(outputPath.value).writeAsString(report);
|
await File(outputPath.value).writeAsString(report);
|
||||||
prnt("\n> Task Completed\n");
|
prnt("\n> Task Completed\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue