comparison doc/libervia-cli/common_arguments.rst @ 3715:b9718216a1c0 0.9

merge bookmark 0.9
author Goffi <goffi@goffi.org>
date Wed, 01 Dec 2021 16:13:31 +0100
parents d0b66efc6c0e
children
comparison
equal deleted inserted replaced
3714:af09b5aaa5d7 3715:b9718216a1c0
85 Note that this is using the pubsub max (i.e. defined in 85 Note that this is using the pubsub max (i.e. defined in
86 `XEP-0060 <https://xmpp.org/extensions/xep-0060.html>`_). Modern pubsub services should 86 `XEP-0060 <https://xmpp.org/extensions/xep-0060.html>`_). Modern pubsub services should
87 implement `Result Set Management <https://xmpp.org/extensions/xep-0059.html>`_ (RSM) and in 87 implement `Result Set Management <https://xmpp.org/extensions/xep-0059.html>`_ (RSM) and in
88 this case the ``-m, --max`` argument should be prefered. See below for RSM common 88 this case the ``-m, --max`` argument should be prefered. See below for RSM common
89 arguments. 89 arguments.
90
91 ``-C, --no-cache``
92 skip pubsub cache. By default, internal pubsub cache is used automatically if requested
93 items are available there. With this option set, a request to the pubsub service will
94 always be done, regardless of presence of node items in internal cache.
90 95
91 result set management 96 result set management
92 ===================== 97 =====================
93 98
94 Result Set Management (RSM) common arguments are used to navigate into pages of results 99 Result Set Management (RSM) common arguments are used to navigate into pages of results
189 Output is used when you want to get the result of the command in a specific way. It may be 194 Output is used when you want to get the result of the command in a specific way. It may be
190 used, for instance, to retrieve the result formatted in JSON so the data can be easily 195 used, for instance, to retrieve the result formatted in JSON so the data can be easily
191 manipulated by a script, or if you want only a specific element of the result. 196 manipulated by a script, or if you want only a specific element of the result.
192 197
193 ``-O {…}, --output {…}`` 198 ``-O {…}, --output {…}``
194 specifiy the output to use. Available options depends of the command you are using, 199 specify the output to use. Available options depends of the command you are using,
195 check ``li [your command] --help`` to know them. 200 check ``li [your command] --help`` to know them.
196 201
197 e.g.:: 202 e.g.::
198 203
199 $ li blog get -O json 204 $ li blog get -O json
207 212
208 $ li blog 213 $ li blog
209 214
210 Some options expect parameters, in this case they can be specified using ``=``. 215 Some options expect parameters, in this case they can be specified using ``=``.
211 216
212 e.g. specifiying a template to use:: 217 e.g. specifying a template to use::
213 218
214 $ li blog get -O template --oo browser --oo template=/tmp/my_template.html 219 $ li blog get -O template --oo browser --oo template=/tmp/my_template.html
220
221 .. _time_pattern:
222
223 Time Pattern
224 ============
225
226 When a command expect a date or date with time argument, you can use a "time pattern" (you
227 usually see the ``TIME_PATTERN`` as name of the argument in ``--help`` message when it can
228 be used).
229
230 This is a flexible way to enter a date, you can enter a date in one of the following way:
231
232 - the string ``now`` to indicate current date and time;
233 - an absolute date using an international format. The parser know many formats (please
234 check dateutil_ package documentation to have a detail of supported formats). Please
235 note that days are specified first and that if no time zone is specified, the local
236 time zone of your computer is assumed;
237 - a relative date (or "relative delta"), see below for details on how to construct it;
238 - a reference time (``now`` or absolute date as above) followed by a relative delta. If
239 the reference time is not specified, ``now`` is used;
240
241 Time pattern is not case sensitive.
242
243 .. _dateutil: https://dateutil.readthedocs.io
244
245 Relative Delta
246 --------------
247
248 A relative delta is specified with:
249
250 - an optional direction ``+`` for times after reference time or ``-`` for time before reference time (defaulting to ``+``);
251 - a number for the quantity of units
252 - a unit (e.g. seconds or minutes), see the bellow for details
253 - the word ``ago`` which is same as using ``-`` for direction (direction and ``ago`` can't
254 be used at the same time)
255
256 Time Units
257 ----------
258
259 The singular or plural form of following units can be used:
260
261 - ``s``, ``sec``, ``second``
262 - ``m``, ``min``, ``minute``
263 - ``h``, ``hr``, ``hour``
264 - ``d``, ``day``
265 - ``w``, ``week``
266 - ``mo``, ``month``
267 - ``y``, ``yr``, ``year``
268
269 examples
270 --------
271
272 - ``2022-01-01``: first of January of 2022 at midnight
273 - ``2017-02-10T13:05:00Z``: 10th of February 2017 at 13:05 UTC
274 - ``2019-07-14 12:00:00 CET``: 14th of July 2019 at 12:00 CET
275 - ``10 min ago``: current time minus 10 minutes
276 - ``now - 10 m``: same as above (current time minus 10 minutes)
277 - ``07/08/2021 +5 hours``: 7 August 2021 at midnight (local time of the computer) + 5
278 hours, i.e. 5 in the morning at local time.
279