about summary refs log tree commit diff stats
path: root/src/catalogue.lil
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2022-12-10 20:18:07 -0500
committerelioat <elioat@tilde.institute>2022-12-10 20:18:07 -0500
commite8cc8cd7db6d887d744e45347d1e6da9dc32e3c6 (patch)
treed58d0ff59d8385d11cb1c9fdd66d77bdd322584e /src/catalogue.lil
parent26b18032b1d2cef857972a657c767382865116d7 (diff)
downloaddecember-2022-e8cc8cd7db6d887d744e45347d1e6da9dc32e3c6.tar.gz
teeny tiny cli user interface
Diffstat (limited to 'src/catalogue.lil')
-rw-r--r--src/catalogue.lil21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/catalogue.lil b/src/catalogue.lil
index b3eb8ba..f30dc3c 100644
--- a/src/catalogue.lil
+++ b/src/catalogue.lil
@@ -18,13 +18,18 @@ on entry d t do
 	# TODO protect against wget fails
 end
 
-# read in a csv, and store in memory as a table
-catalogue:load_db[csv_db]
+if args[2] do
+	url:args[2]
+	# read in a csv, and store in memory as a table
+	catalogue:load_db[csv_db]
 
-# add a row to the table stored in memory
-row.url:"https://tenforward.social"
-row:table row
-catalogue:entry[row catalogue]
+	# add a row to the table stored in memory
+	row.url:url
+	row:table row
+	catalogue:entry[row catalogue]
 
-# write the updated data to csv
-save_db[catalogue csv_db]
+	# write the updated data to csv
+	save_db[catalogue csv_db]
+else 
+	print["\n    please pass a url as an argument\n"]
+end 
\ No newline at end of file