diff options
-rw-r--r-- | COPYING | 9 | ||||
-rw-r--r-- | pls.fnl | 5 | ||||
-rw-r--r-- | radish.fnl | 66 |
3 files changed, 76 insertions, 4 deletions
diff --git a/COPYING b/COPYING index 4d13a5b..3b71e1f 100644 --- a/COPYING +++ b/COPYING | |||
@@ -1,7 +1,8 @@ | |||
1 | Copyright (C) 2022 Case Duckworth <acdw@acdw.net> | 1 | Copyright (C) 2022 Case Duckworth <acdw@acdw.net> |
2 | 2 | ||
3 | Usage of the works is permitted provided that this instrument is retained with | 3 | Everyone is permitted to do whatever with this software, without |
4 | the works, so that any entity that uses the works is notified of this | 4 | limitation. This software comes without any warranty whatsoever, |
5 | instrument. | 5 | but with two pieces of advice: |
6 | 6 | ||
7 | DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. | 7 | - Don't hurt yourself. |
8 | - 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 @@ | |||
1 | ;;; PLS.fnl | ||
2 | ;; a parser for *.pls files | ||
3 | ;; Copyright (C) 2022 Case Duckworth <acdw@acdw.net> | ||
4 | ;; License: Good Choices (https://acdw.casa/gcl) | ||
5 | |||
diff --git a/radish.fnl b/radish.fnl new file mode 100644 index 0000000..4ce6e22 --- /dev/null +++ b/radish.fnl | |||
@@ -0,0 +1,66 @@ | |||
1 | ;;; RADISH | ||
2 | ;; A tuner for various streams | ||
3 | ;; Copyright (C) 2022 Case Duckworth <acdw@acdw.net> | ||
4 | ;; License: Good Choices (https://acdw.casa/gcl) | ||
5 | |||
6 | ;;; Entry point | ||
7 | |||
8 | (fn usage [] | ||
9 | (printn* "RADISH: a tuner for various streams" | ||
10 | "Copyright (C) 2022 Case Duckworth <acdw@acdw.net>" | ||
11 | "License: Good Choices (https://acdw.casa/gcl)" | ||
12 | "" | ||
13 | "Commands" | ||
14 | " radish [STATION]" | ||
15 | " Begin playing STATION. If STATION is not" | ||
16 | " provided, display a list of favorites and" | ||
17 | " allow the user to choose one to play." | ||
18 | " radish play [STATION]" | ||
19 | " Begin playing STATION. If STATION is not" | ||
20 | " provided, play the most recently-played." | ||
21 | " radish kill" | ||
22 | " Kill the currently-playing station." | ||
23 | " radish add [STATION]" | ||
24 | " Add STATION or the currently-playing one" | ||
25 | " to the favorites list." | ||
26 | " radish del [STATION]" | ||
27 | " Remove STATION or the currently-playing" | ||
28 | " one from the favorites list." | ||
29 | " radish edit [STATION]" | ||
30 | " Edit the information of STATION, or the" | ||
31 | " current one if not given." | ||
32 | "" | ||
33 | "See radish(1) for more details.")) | ||
34 | |||
35 | (fn main [args] | ||
36 | (match args | ||
37 | [:play ?station] (radish-play ?station) | ||
38 | [:kill] (radish-kill) | ||
39 | [:add ?station] (radish-add ?station) | ||
40 | [:del ?station] (radish-del ?station) | ||
41 | [:edit ?station] (radish-edit ?station) | ||
42 | [station] (radish-play station) | ||
43 | _ (usage))) | ||
44 | |||
45 | ;;; Utilities | ||
46 | |||
47 | (lambda printn* [?sep ...] | ||
48 | "Print arguments as strings, delimited by ?SEP. | ||
49 | ?SEP defaults to '\n', but can be anything." | ||
50 | (print (table.concat [...] (or ?sep "\n")))) | ||
51 | |||
52 | ;;; Functionality | ||
53 | |||
54 | (lambda radish-play [?station]) | ||
55 | |||
56 | (lambda radish-kill []) | ||
57 | |||
58 | (lambda radish-add [?station]) | ||
59 | |||
60 | (lambda radish-del [?station]) | ||
61 | |||
62 | (lambda radish-edit [?station]) | ||
63 | |||
64 | ;;; End | ||
65 | |||
66 | (main args) | ||