aboutsummaryrefslogtreecommitdiff
path: root/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'main.ts')
-rw-r--r--main.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/main.ts b/main.ts
index 37a0942..7577785 100644
--- a/main.ts
+++ b/main.ts
@@ -1,23 +1,19 @@
-import {
- syncCountries,
- printCountry,
- findCountry,
- randomCountry,
-} from "./countries.util.ts";
+import { Countries } from "./countries.ts";
-await syncCountries();
+const countries = new Countries();
+
+await countries.sync();
const arg = Deno.args[0];
if (arg === "sync") {
- await syncCountries(true);
+ await countries.sync({ force: true });
}
if (arg === "random") {
- printCountry(randomCountry());
+ countries.print(countries.random());
}
if (arg === "find") {
- let selectedCountry = findCountry(Deno.args[1]);
- printCountry(selectedCountry);
+ countries.print(Deno.args[1]);
}