diff options
author | elioat <elioat@tilde.institute> | 2022-12-10 20:29:40 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2022-12-10 20:29:40 -0500 |
commit | dee96444e1c611e7152f914a3f540d5f4d366097 (patch) | |
tree | aab722df97b07776038646a5877e9917f50135ff /src | |
parent | e8cc8cd7db6d887d744e45347d1e6da9dc32e3c6 (diff) | |
download | december-2022-dee96444e1c611e7152f914a3f540d5f4d366097.tar.gz |
ui
Diffstat (limited to 'src')
-rw-r--r-- | src/catalogue.lil | 19 | ||||
-rw-r--r-- | src/test.csv | 3 |
2 files changed, 14 insertions, 8 deletions
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 |