From dee96444e1c611e7152f914a3f540d5f4d366097 Mon Sep 17 00:00:00 2001 From: elioat Date: Sat, 10 Dec 2022 20:29:40 -0500 Subject: ui --- src/catalogue.lil | 19 ++++++++++++------- src/test.csv | 3 ++- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/catalogue.lil b/src/catalogue.lil index f30dc3c..4c719e2 100644 --- a/src/catalogue.lil +++ b/src/catalogue.lil @@ -19,17 +19,22 @@ on entry d t do end 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:url - row:table row - catalogue:entry[row catalogue] + if args[2] ~ "-l" do + show[catalogue] # listing everything is probs not the most ideal if you've got thousands of entries... + else + url:args[2] - # write the updated data to csv - save_db[catalogue csv_db] + # 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] + end else print["\n please pass a url as an argument\n"] end \ No newline at end of file diff --git a/src/test.csv b/src/test.csv index 35bd89b..c0b5fe6 100644 --- a/src/test.csv +++ b/src/test.csv @@ -1,4 +1,5 @@ title,reference,created_date small and nearly silent | pubnix programming playground for friends,https://smallandnearlysilent.com,2022-12-10 Oatmeal,https://eli.li,2022-12-10 -Ten Forward,https://tenforward.social,2022-12-10 \ No newline at end of file +Ten Forward,https://tenforward.social,2022-12-10 +"DuckDuckGo Privacy, simplified.",https://duckduckgo.com,2022-12-10 \ No newline at end of file -- cgit 1.4.1-2-gfad0