Setup day 4 command

This commit is contained in:
2025-12-08 11:30:50 -06:00
parent 6e3781be93
commit 5acf83e63d
5 changed files with 41 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ class Day1Command extends Command {
print(
"Expected 1 positional arguments, found ${argResults!.rest.length}",
);
exit(1);
}
var fileName = argResults!.rest[0];

View File

@@ -26,6 +26,7 @@ class Day2Command extends Command {
print(
"Expected 1 positional arguments, found ${argResults!.rest.length}",
);
exit(1);
}
var filePath = argResults!.rest[0];

View File

@@ -27,6 +27,7 @@ class Day3Command extends Command {
print(
"Expected 1 positional arguments, found ${argResults!.rest.length}",
);
exit(1);
}
var filePath = argResults!.rest[0];

36
lib/day4/command.dart Normal file
View File

@@ -0,0 +1,36 @@
import "dart:convert";
import "dart:io";
import "package:args/command_runner.dart";
class Day4Command extends Command {
// The [name] and [description] properties must be defined by every
// subclass.
@override
final name = "day4";
@override
final description = "Run Advent of Code 2025 Day 3";
Day4Command() {
// we can add command specific arguments here.
// [argParser] is automatically created by the parent class.
}
// [run] may also return a Future.
@override
Future<void> run() async {
// [argResults] is set before [run()] is called and contains the flags/options
// passed to this command.
if (argResults!.rest.length != 1) {
print(
"Expected 1 positional arguments, found ${argResults!.rest.length}",
);
exit(1);
}
var filePath = argResults!.rest[0];
print("Parsing file: $filePath");
}
}