From: Siraaj Khandkar Date: Sat, 20 Mar 2021 22:58:23 +0000 (-0400) Subject: Support upload command X-Git-Tag: 0.9.0 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=3a4b22332acd7b76bcbe4150b5eba9fc80b7f459;p=tt.git Support upload command as an alias to a user-provided script. --- diff --git a/TODO b/TODO index a9b9446..78b5588 100644 --- 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. diff --git a/info.rkt b/info.rkt index 599236f..860794a 100644 --- 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 ")) (define deps diff --git a/tt.rkt b/tt.rkt index 4b90055..59214ff 100644 --- a/tt.rkt +++ b/tt.rkt @@ -305,6 +305,7 @@ "and 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) @@ -329,6 +330,14 @@ (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])