Accept a path argument on the command line

This commit is contained in:
King_DuckZ 2020-03-04 02:40:03 +01:00
parent a105c69723
commit 4c095996cc

View file

@ -4,10 +4,15 @@ import std.typecons;
import gamesdb; import gamesdb;
import isotoserial; import isotoserial;
int main() { int main(string[] argv) {
Unique!GamesDB db = new GamesDB; Unique!GamesDB db = new GamesDB;
string serial = iso_to_serial("/home/michele/deleme/b-mikuex.iso"); if (argv.length != 2) {
stderr.writeln("Usage: psp2name <path_to_psp_iso>");
return 2;
}
string serial = iso_to_serial(argv[1]);
writeln(db.find_by_serial(serial)); writeln(db.find_by_serial(serial));
return 0; return 0;
} }