From d2073cfead2de49ca48198cf4e8110cb189358d1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 28 Jul 2022 21:21:13 -0500 Subject: Begin converting to fennel --- COPYING | 9 +++++---- pls.fnl | 5 +++++ radish.fnl | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 pls.fnl create mode 100644 radish.fnl diff --git a/COPYING b/COPYING index 4d13a5b..3b71e1f 100644 --- a/COPYING +++ b/COPYING @@ -1,7 +1,8 @@ Copyright (C) 2022 Case Duckworth -Usage of the works is permitted provided that this instrument is retained with -the works, so that any entity that uses the works is notified of this -instrument. +Everyone is permitted to do whatever with this software, without +limitation. This software comes without any warranty whatsoever, +but with two pieces of advice: -DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. +- Don't hurt yourself. +- Make good choices. diff --git a/pls.fnl b/pls.fnl new file mode 100644 index 0000000..0ba2fb8 --- /dev/null +++ b/pls.fnl @@ -0,0 +1,5 @@ +;;; PLS.fnl +;; a parser for *.pls files +;; Copyright (C) 2022 Case Duckworth +;; License: Good Choices (https://acdw.casa/gcl) + diff --git a/radish.fnl b/radish.fnl new file mode 100644 index 0000000..4ce6e22 --- /dev/null +++ b/radish.fnl @@ -0,0 +1,66 @@ +;;; RADISH +;; A tuner for various streams +;; Copyright (C) 2022 Case Duckworth +;; License: Good Choices (https://acdw.casa/gcl) + +;;; Entry point + +(fn usage [] + (printn* "RADISH: a tuner for various streams" + "Copyright (C) 2022 Case Duckworth " + "License: Good Choices (https://acdw.casa/gcl)" + "" + "Commands" + " radish [STATION]" + " Begin playing STATION. If STATION is not" + " provided, display a list of favorites and" + " allow the user to choose one to play." + " radish play [STATION]" + " Begin playing STATION. If STATION is not" + " provided, play the most recently-played." + " radish kill" + " Kill the currently-playing station." + " radish add [STATION]" + " Add STATION or the currently-playing one" + " to the favorites list." + " radish del [STATION]" + " Remove STATION or the currently-playing" + " one from the favorites list." + " radish edit [STATION]" + " Edit the information of STATION, or the" + " current one if not given." + "" + "See radish(1) for more details.")) + +(fn main [args] + (match args + [:play ?station] (radish-play ?station) + [:kill] (radish-kill) + [:add ?station] (radish-add ?station) + [:del ?station] (radish-del ?station) + [:edit ?station] (radish-edit ?station) + [station] (radish-play station) + _ (usage))) + +;;; Utilities + +(lambda printn* [?sep ...] + "Print arguments as strings, delimited by ?SEP. +?SEP defaults to '\n', but can be anything." + (print (table.concat [...] (or ?sep "\n")))) + +;;; Functionality + +(lambda radish-play [?station]) + +(lambda radish-kill []) + +(lambda radish-add [?station]) + +(lambda radish-del [?station]) + +(lambda radish-edit [?station]) + +;;; End + +(main args) -- cgit 1.4.1-21-gabe81