1
0
Fork 0

- added the reset of timeline pagination from command line.

This commit is contained in:
cage 2020-05-18 19:16:52 +02:00
parent 38411e1a19
commit 1548229b28
7 changed files with 86 additions and 55 deletions

View File

@ -19,13 +19,17 @@
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]])
+ -e, --execute-script SCRIPT-FILE :: Execute a script file + -R, --reset-timeline-pagination ::
Reset the timeline pagination. By default the new toots are fetched
starting from the last one downloaded from the instance, this switch
will force the program to fetch the last message posted by users
+ -c, --check-follows-requests :: Checks for follow request at start + -c, --check-follows-requests :: Checks for follow request at start
+ -u, --update-timeline :: Update the selected timeline + -e, --execute-script SCRIPT-FILE :: Execute a script file
+ -t, --timeline TIMELINE-NAME :: Start using this timeline
+ -f, --folder FOLDER-NAME :: Start on that folder + -f, --folder FOLDER-NAME :: Start on that folder
+ -v, --version :: Print program version and exit
+ -h, --help :: print program help and exit + -h, --help :: print program help and exit
+ -t, --timeline TIMELINE-NAME :: Start using this timeline
+ -u, --update-timeline :: Update the selected timeline
+ -v, --version :: Print program version and exit
* Usage * Usage

View File

@ -24,26 +24,31 @@ 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 .TP
\fB-e, --execute-script SCRIPT-FILE\fP \fB-R, --reset-timeline-pagination \fP
Execute a script file Reset the timeline pagination. By default the new toots are fetched
starting from the last one downloaded from the instance, this switch
will force the program to fetch the last message posted by users
.TP .TP
\fB-c, --check-follows-requests \fP \fB-c, --check-follows-requests \fP
Checks for follow request at start Checks for follow request at start
.TP .TP
\fB-u, --update-timeline \fP \fB-e, --execute-script SCRIPT-FILE\fP
Update the selected timeline Execute a script file
.TP
\fB-t, --timeline TIMELINE-NAME \fP
Start using this timeline
.TP .TP
\fB-f, --folder FOLDER-NAME \fP \fB-f, --folder FOLDER-NAME \fP
Start on that folder Start on that folder
.TP .TP
\fB-v, --version \fP
Print program version and exit
.TP
\fB-h, --help \fP \fB-h, --help \fP
print program help and exit print program help and exit
.TP
\fB-t, --timeline TIMELINE-NAME \fP
Start using this timeline
.TP
\fB-u, --update-timeline \fP
Update the selected timeline
.TP
\fB-v, --version \fP
Print program version and exit
.SH "Usage" .SH "Usage"
.PP .PP

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-05-17 17:47+0200\n" "POT-Creation-Date: 2020-05-18 19:14+0200\n"
"PO-Revision-Date: 2020-05-17 17:49+0200\n" "PO-Revision-Date: 2020-05-18 19:15+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"
@ -107,14 +107,18 @@ msgid "Update timeline"
msgstr "Aggiorna la timeline" msgstr "Aggiorna la timeline"
#: src/command-line.lisp:50 #: src/command-line.lisp:50
msgid "Reset the timeline pagination"
msgstr "resetta la paginazione della timeline"
#: src/command-line.lisp:54
msgid "Check follows requests" msgid "Check follows requests"
msgstr "Controlla le richieste di poterti seguire" msgstr "Controlla le richieste di poterti seguire"
#: src/command-line.lisp:54 #: src/command-line.lisp:58
msgid "Execute script" msgid "Execute script"
msgstr "Esegui script" msgstr "Esegui script"
#: src/command-line.lisp:57 #: src/command-line.lisp:61
msgid "SCRIPT-FILE" msgid "SCRIPT-FILE"
msgstr "SCRIPT-FILE" msgstr "SCRIPT-FILE"

View File

@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: tinmop 0.0.1\n" "Project-Id-Version: tinmop 0.0.2\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-05-17 17:47+0200\n" "POT-Creation-Date: 2020-05-18 19:14+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"
@ -103,14 +103,18 @@ msgid "Update timeline"
msgstr "" msgstr ""
#: src/command-line.lisp:50 #: src/command-line.lisp:50
msgid "Check follows requests" msgid "Reset the timeline pagination"
msgstr "" msgstr ""
#: src/command-line.lisp:54 #: src/command-line.lisp:54
msgid "Check follows requests"
msgstr ""
#: src/command-line.lisp:58
msgid "Execute script" msgid "Execute script"
msgstr "" msgstr ""
#: src/command-line.lisp:57 #: src/command-line.lisp:61
msgid "SCRIPT-FILE" msgid "SCRIPT-FILE"
msgstr "" msgstr ""

View File

@ -23,49 +23,55 @@
(defmacro gen-opts () (defmacro gen-opts ()
`(opts:define-opts `(opts:define-opts
(:name :help (:name :help
:description (_ "Print help and exit") :description (_ "Print help and exit")
:short #\h :short #\h
:long "help") :long "help")
(:name :version (:name :version
:description (_ "Print program information and exit") :description (_ "Print program information and exit")
:short #\v :short #\v
:long "version") :long "version")
(:name :folder (:name :folder
:description (_ "Starting folder") :description (_ "Starting folder")
:short #\f :short #\f
:arg-parser #'identity :arg-parser #'identity
:meta-var (_ "FOLDER-NAME") :meta-var (_ "FOLDER-NAME")
:long "folder") :long "folder")
(:name :timeline (:name :timeline
:description (_ "Starting timeline") :description (_ "Starting timeline")
:short #\t :short #\t
:meta-var (_ "TIMELINE-NAME") :meta-var (_ "TIMELINE-NAME")
:arg-parser #'identity :arg-parser #'identity
:long "timeline") :long "timeline")
(:name :update-timeline (:name :update-timeline
:description (_ "Update timeline") :description (_ "Update timeline")
:short #\u :short #\u
:long "update-timeline") :long "reset-timeline-pagination")
(:name :reset-timeline-pagination
:description (_ "Reset the timeline pagination")
:short #\R
:long "reset-timeline-pagination")
(:name :check-follows-requests (:name :check-follows-requests
:description (_ "Check follows requests") :description (_ "Check follows requests")
:short #\c :short #\c
:long "check-follows-requests") :long "check-follows-requests")
(:name :execute (:name :execute
:description (_ "Execute script") :description (_ "Execute script")
:short #\e :short #\e
:arg-parser #'identity :arg-parser #'identity
:meta-var (_ "SCRIPT-FILE") :meta-var (_ "SCRIPT-FILE")
:long "execute-script"))) :long "execute-script")))
(defparameter *start-folder* nil) (defparameter *start-folder* nil)
(defparameter *start-timeline* nil) (defparameter *start-timeline* nil)
(defparameter *update-timeline* nil) (defparameter *update-timeline* nil)
(defparameter *script-file* nil) (defparameter *script-file* nil)
(defparameter *check-follow-requests* nil) (defparameter *check-follow-requests* nil)
(defparameter *reset-timeline-pagination* nil)
(defun exit-on-error (e) (defun exit-on-error (e)
(format *error-output* "~a~%" e) (format *error-output* "~a~%" e)
@ -88,8 +94,10 @@
(setf *start-folder* (getf options :folder))) (setf *start-folder* (getf options :folder)))
(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)
(setf *reset-timeline-pagination* t))
(when (getf options :update-timeline) (when (getf options :update-timeline)
(setf *update-timeline* (getf options :update-timeline))) (setf *update-timeline* t))
(when (getf options :execute) (when (getf options :execute)
(setf *script-file* (getf options :execute))) (setf *script-file* (getf options :execute)))
(when (getf options :check-follows-requests) (when (getf options :check-follows-requests)

View File

@ -81,6 +81,9 @@ etc.) happened"
:new-timeline command-line:*start-timeline*))) :new-timeline command-line:*start-timeline*)))
(program-events:push-event refresh-event))) (program-events:push-event refresh-event)))
(defun reset-timeline-pagination ()
(ui:reset-timeline-pagination))
(defun load-configuration-files () (defun load-configuration-files ()
(swconf:load-config-file swconf:+shared-conf-filename+) (swconf:load-config-file swconf:+shared-conf-filename+)
(swconf:load-config-file swconf:+conf-filename+)) (swconf:load-config-file swconf:+conf-filename+))
@ -115,6 +118,8 @@ etc.) happened"
(change-folder)) (change-folder))
(when command-line:*start-timeline* (when command-line:*start-timeline*
(change-timeline))) (change-timeline)))
(when command-line:*reset-timeline-pagination*
(reset-timeline-pagination))
(when command-line:*update-timeline* (when command-line:*update-timeline*
(ui:update-current-timeline)) (ui:update-current-timeline))
(when command-line:*check-follow-requests* (when command-line:*check-follow-requests*

View File

@ -1974,6 +1974,7 @@
:*update-timeline* :*update-timeline*
:*script-file* :*script-file*
:*check-follow-requests* :*check-follow-requests*
:*reset-timeline-pagination*
:manage-opts)) :manage-opts))
(defpackage :main (defpackage :main