Support upload command 0.9.0
authorSiraaj Khandkar <siraaj@khandkar.net>
Sat, 20 Mar 2021 22:58:23 +0000 (18:58 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sat, 20 Mar 2021 22:58:23 +0000 (18:58 -0400)
as an alias to a user-provided script.

TODO
info.rkt
tt.rkt

diff --git a/TODO b/TODO
index a9b9446..78b5588 100644 (file)
--- a/TODO
+++ b/TODO
@@ -36,7 +36,7 @@
     - see timeline ops above
     - see hashtag and channels above
   - [x] d | download
-  - [ ] u | upload
+  - [x] u | upload
     - calls user-configured command to upload user's own feed file to their server
   Looks like a better CLI parser than "racket/cmdline": https://docs.racket-lang.org/natural-cli/
   But it is no longer necessary now that I've figured out how to chain (command-line ..) calls.
index 599236f..860794a 100644 (file)
--- a/info.rkt
+++ b/info.rkt
@@ -6,7 +6,7 @@
 (define pkg-desc
   "twtxt client")
 (define version
-  "0.8.0")
+  "0.9.0")
 (define pkg-authors
   '("Siraaj Khandkar <siraaj@khandkar.net>"))
 (define deps
diff --git a/tt.rkt b/tt.rkt
index 4b90055..59214ff 100644 (file)
--- a/tt.rkt
+++ b/tt.rkt
       "and <command> is one of"
       "r, read i   : Read the timeline."
       "d, download : Download the timeline."
+      "u, upload   : Upload your twtxt file (alias to execute ~/.tt/upload)."
       ""
       #:args (command . args)
       (start-logger log-level)
                (current-http-client/user-agent user-agent))
              (timeline-download num_workers (file->feeds filename))
              ))]
+        [(or "u" "upload")
+         (command-line
+             #:program
+             "tt upload"
+             #:args ()
+             (if (system (path->string (expand-user-path "~/.tt/upload")))
+               (exit 0)
+               (exit 1)))]
         [(or "r" "read")
          (let ([out-format 'multi-line]
                [order      'old->new])
This page took 0.02979 seconds and 4 git commands to generate.