1
0
Fork 0

- added a command line option to retrieve a gemini URL.

This commit is contained in:
cage 2020-06-23 15:51:43 +02:00
parent f861d80b8c
commit 28917208d6
7 changed files with 46 additions and 20 deletions

View File

@ -20,6 +20,7 @@
Without options the program will start a terminal interface and will Without options the program will start a terminal interface and will
try to connect to your instance (see [[Configuration]]) try to connect to your instance (see [[Configuration]])
+ -o, --open-gemini-url ARG :: Open gemini url
+ -m, --notify-mentions ARG :: Notify messages that mentions the user + -m, --notify-mentions ARG :: Notify messages that mentions the user
+ -R, --reset-timeline-pagination :: + -R, --reset-timeline-pagination ::
Reset the timeline pagination. By default the new toots are fetched Reset the timeline pagination. By default the new toots are fetched

View File

@ -23,6 +23,9 @@ social network
Without options the program will start a terminal interface and will Without options the program will start a terminal interface and will
try to connect to your instance (see \fIConfiguration\fP) try to connect to your instance (see \fIConfiguration\fP)
.TP
\fB-o, --open-gemini-url ARG \fP
Open gemini url
.TP .TP
\fB-m, --notify-mentions ARG \fP \fB-m, --notify-mentions ARG \fP
Notify messages that mentions the user Notify messages that mentions the user

View File

@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: tinmop 0.0.1\n" "Project-Id-Version: tinmop 0.0.1\n"
"Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n" "Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n"
"POT-Creation-Date: 2020-06-23 11:19+0200\n" "POT-Creation-Date: 2020-06-23 15:48+0200\n"
"PO-Revision-Date: 2020-06-23 11:19+0200\n" "PO-Revision-Date: 2020-06-23 15:49+0200\n"
"Last-Translator: cage <cage@invalid.org>\n" "Last-Translator: cage <cage@invalid.org>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
"Language: it\n" "Language: it\n"
@ -126,6 +126,10 @@ msgstr "SCRIPT-FILE"
msgid "Notify messages that mentions the user" msgid "Notify messages that mentions the user"
msgstr "Notifica i messaggi che menzionano l'utente." msgstr "Notifica i messaggi che menzionano l'utente."
#: src/command-line.lisp:69
msgid "Open gemini url"
msgstr "Apri un indirizzo gemini"
#: src/command-window.lisp:299 #: src/command-window.lisp:299
#, lisp-format #, lisp-format
msgid "Error: command ~a not found" msgid "Error: command ~a not found"
@ -190,12 +194,12 @@ msgstr ""
"La firma dell'host ~s è cambiata! Questo è un potenziale problema di " "La firma dell'host ~s è cambiata! Questo è un potenziale problema di "
"sicurezza! Proseguire? [s/N]" "sicurezza! Proseguire? [s/N]"
#: src/gemini-viewer.lisp:98 src/tui-utils.lisp:478 #: src/gemini-viewer.lisp:97 src/tui-utils.lisp:478
#, lisp-format #, lisp-format
msgid "Error: ~a" msgid "Error: ~a"
msgstr "Errore: ~a" msgstr "Errore: ~a"
#: src/gemini-viewer.lisp:103 #: src/gemini-viewer.lisp:104
#, lisp-format #, lisp-format
msgid "Error getting ~s: ~a" msgid "Error getting ~s: ~a"
msgstr "Errore connettendomi a ~s: ~a" msgstr "Errore connettendomi a ~s: ~a"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: tinmop 0.0.9\n" "Project-Id-Version: tinmop 0.0.9\n"
"Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n" "Report-Msgid-Bugs-To: https://notabug.org/cage/tinmop/\n"
"POT-Creation-Date: 2020-06-23 11:19+0200\n" "POT-Creation-Date: 2020-06-23 15:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -122,6 +122,10 @@ msgstr ""
msgid "Notify messages that mentions the user" msgid "Notify messages that mentions the user"
msgstr "" msgstr ""
#: src/command-line.lisp:69
msgid "Open gemini url"
msgstr ""
#: src/command-window.lisp:299 #: src/command-window.lisp:299
#, lisp-format #, lisp-format
msgid "Error: command ~a not found" msgid "Error: command ~a not found"
@ -181,12 +185,12 @@ msgid ""
"warning? [y/N] " "warning? [y/N] "
msgstr "" msgstr ""
#: src/gemini-viewer.lisp:98 src/tui-utils.lisp:478 #: src/gemini-viewer.lisp:97 src/tui-utils.lisp:478
#, lisp-format #, lisp-format
msgid "Error: ~a" msgid "Error: ~a"
msgstr "" msgstr ""
#: src/gemini-viewer.lisp:103 #: src/gemini-viewer.lisp:104
#, lisp-format #, lisp-format
msgid "Error getting ~s: ~a" msgid "Error getting ~s: ~a"
msgstr "" msgstr ""

View File

@ -64,8 +64,12 @@
:description (_ "Notify messages that mentions the user") :description (_ "Notify messages that mentions the user")
:short #\m :short #\m
:arg-parser #'identity :arg-parser #'identity
:long "notify-mentions"))) :long "notify-mentions")
(:name :open-gemini-url
:description (_ "Open gemini url")
:short #\o
:arg-parser #'identity
:long "open-gemini-url")))
(defparameter *start-folder* nil) (defparameter *start-folder* nil)
@ -81,6 +85,8 @@
(defparameter *notify-mentions* nil) (defparameter *notify-mentions* nil)
(defparameter *gemini-url* nil)
(defparameter *update-timeline-climb-message-tree* nil) (defparameter *update-timeline-climb-message-tree* nil)
(defun exit-on-error (e) (defun exit-on-error (e)
@ -102,6 +108,8 @@
(os-utils:exit-program)) (os-utils:exit-program))
(when (getf options :folder) (when (getf options :folder)
(setf *start-folder* (getf options :folder))) (setf *start-folder* (getf options :folder)))
(when (getf options :open-gemini-url)
(setf *gemini-url* (getf options :open-gemini-url)))
(when (getf options :timeline) (when (getf options :timeline)
(setf *start-timeline* (getf options :timeline))) (setf *start-timeline* (getf options :timeline)))
(when (getf options :reset-timeline-pagination) (when (getf options :reset-timeline-pagination)

View File

@ -116,17 +116,22 @@ etc.) happened"
;; now init the client ;; now init the client
(client:init) (client:init)
(client:authorize) (client:authorize)
(let ((program-events:*process-events-immediately* t)) (if command-line:*gemini-url*
(when command-line:*start-timeline* (progn
(change-timeline)) (gemini-viewer:request *gemini-url*)
(when command-line:*start-folder* (ui:focus-to-message-window))
(change-folder))) (progn
(when command-line:*reset-timeline-pagination* (let ((program-events:*process-events-immediately* t))
(reset-timeline-pagination)) (when command-line:*start-timeline*
(when command-line:*update-timeline* (change-timeline))
(ui:update-current-timeline)) (when command-line:*start-folder*
(when command-line:*check-follow-requests* (change-folder)))
(ui:start-follow-request-processing)))) (when command-line:*reset-timeline-pagination*
(reset-timeline-pagination))
(when command-line:*update-timeline*
(ui:update-current-timeline))
(when command-line:*check-follow-requests*
(ui:start-follow-request-processing))))))
(defun run () (defun run ()
(windows:with-croatoan-window (croatoan-window specials:*main-window*) (windows:with-croatoan-window (croatoan-window specials:*main-window*)

View File

@ -1066,6 +1066,7 @@
:*check-follow-requests* :*check-follow-requests*
:*reset-timeline-pagination* :*reset-timeline-pagination*
:*notify-mentions* :*notify-mentions*
:*gemini-url*
:*update-timeline-climb-message-tree* :*update-timeline-climb-message-tree*
:manage-opts)) :manage-opts))