Mercurial > libervia-backend
annotate doc/jp/common_arguments.rst @ 3042:964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
The frontends D-Bus bridge has now an AIOBridge version which can be instantiated to use asyncio (the loop must be managed by frontends).
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 01 Oct 2019 22:49:10 +0200 |
parents | 72583524cfd3 |
children | d2a26ec74b31 |
rev | line source |
---|---|
2946 | 1 ================ |
2 common arguments | |
3 ================ | |
4 | |
5 Some arguments are used in many commands. This page describe them. | |
6 | |
3041
72583524cfd3
doc (jp): jp commands are now fully documented:
Goffi <goffi@goffi.org>
parents:
3021
diff
changeset
|
7 .. _jp-common_profile: |
72583524cfd3
doc (jp): jp commands are now fully documented:
Goffi <goffi@goffi.org>
parents:
3021
diff
changeset
|
8 |
2946 | 9 profile |
10 ======= | |
11 | |
12 profile arguments are really common, they allow you to select your profile. | |
13 If you don't select any, the default profile is used, which is the first | |
14 profile created or the one you have explicitly set. You can check which profile | |
15 is used by default with ``jp profile default``. | |
16 | |
17 The common arguments for profile are: | |
18 | |
19 ``-p PROFILE, --profile PROFILE`` | |
20 to select the name of your profile. It can be a profile key like ``@DEFAULT@`` | |
21 | |
22 ``-c, --connect`` | |
23 connect the profile to the XMPP server before doing anything else. If your | |
24 profile is already connected, nothing happen. This is specially useful in scripts. | |
25 | |
26 ``--start-session`` | |
27 starts a session without connecting, this can be needed if you can't connect but | |
28 you need to access your session e.g. to change parameters. | |
29 This is advanced used and is not need in most common cases. | |
30 | |
31 ``--pwd PASSWORD`` | |
32 the password of your profile, needed if the session is not started yet. | |
33 | |
34 .. note:: | |
35 | |
36 jp does not yet prompt for password when needed, this mean that using the ``--pwd`` | |
37 option is not secure if you are not the only user of your machine: the password will | |
38 appear **IN CLEAR** in the list of launched process, or in the history of your shell. | |
39 If you are on a shared machine or if anybody can access your shell history at some | |
40 point, you should connect first your profile with an other frontend (Primitivus for | |
41 instance). This will be fixed in a future version of jp. | |
42 | |
43 .. _pubsub_common: | |
44 | |
45 pubsub | |
46 ====== | |
47 | |
48 pubsub arguments are used in many commands, they allow you to select a service, node and | |
49 items. Depending on the command, you may only not be able to select an item, or you may | |
50 select one or multiple items. | |
51 | |
52 The common arguments for pubsub are: | |
53 | |
54 ``-u PUBSUB_URL, --pubsub-url PUBSUB_URL`` | |
55 retrieve pubsub information from an URL. You can use either and ``xmpp:`` scheme or an | |
56 ``https:`` (or ``http:``) scheme. In the later case, the HTML page will be downloaded to | |
57 retrieve the location of the XMPP node/item, if available. | |
58 Note that you can override parts of the location in the URL if you specify service, node | |
59 or item. | |
60 | |
61 e.g.:: | |
62 | |
63 $ jp blog get -u https://www.goffi.org | |
64 | |
65 ``-s SERVICE, --service`` | |
66 used to specifiy the JID of the pubsub service | |
67 | |
68 ``-n NODE, --node NODE`` | |
69 used to specifiy the pubsub node | |
70 | |
71 ``-i ITEM, --item ITEM`` | |
72 for commands where an item can be specified, you do it with this option. In some | |
73 commands, multiple items can be specified, in this case just use this arguments several | |
74 times. | |
75 | |
76 ``-L, --last-item`` | |
77 when an item id is needed, you can use this option to retrieve the last published item. | |
78 e.g.:: | |
79 | |
80 $ jp blog edit --last-item | |
81 | |
82 ``-M, --max-items`` | |
83 use to specify a maxium number of items to retrieve, when it makes sense. | |
84 Note that this is using the pubsub max (i.e. defined in | |
85 `XEP-0060 <https://xmpp.org/extensions/xep-0060.html>`_). Modern pubsub services should | |
86 implement `Result Set Management <https://xmpp.org/extensions/xep-0059.html>`_ (RSM) and in | |
87 this case the ``-m, --max`` argument should be prefered. See below for RSM common | |
88 arguments. | |
89 | |
90 result set management | |
91 ===================== | |
92 | |
93 Result Set Management (RSM) common arguments are used to navigate into pages of results | |
94 when lot of elements may be expected. Given a result with a large number of arguments, a | |
95 *page* is set of elements which correspond to an *index* (a page number). For instance if | |
96 you have 123 elements, you can ask them 10 by 10, and *index 1* match elements from 11 to | |
97 20 included. | |
98 | |
99 | |
100 ``-a ITEM_ID, --after ITEM_ID`` | |
101 find page after this item. You usually use the last item id of the latest page you got. | |
102 | |
103 ``-b ITEM_ID, --before ITEM_ID`` | |
104 find page before this item. This this usually used when you check items backwards | |
105 | |
106 ``--index RSM_INDEX`` | |
107 index of the page to retrieve. Note that first page has index **0**. | |
108 | |
109 ``-m RSM_MAX, --max RSM_MAX`` | |
110 used to specify a maxium number of items to retrieve per page. Note that the actual | |
111 maximum number of items per page used may be lower if the service used consider that | |
112 your request is too big. | |
113 | |
114 message archive management | |
115 ========================== | |
116 | |
117 Message Archive Management (MAM) argument is used by some commands (related to instant message or | |
118 pubsub) to filter results. | |
119 | |
120 There is currently only one argument in this group: | |
121 | |
122 ``-f FILTER_NAME VALUE, --filter FILTER_NAME VALUE`` | |
123 specify a MAM filter to use. Depending on the service supporting MAM, some filters can | |
124 be used to do things like full text search. The available filters depend on the service | |
125 you use, please check documentation of your service. | |
126 | |
127 order-by | |
128 ======== | |
129 | |
2957 | 130 Order-By argument specify how the returned elements are sorted. |
2946 | 131 |
132 There is currently only one argument in this group: | |
133 | |
134 ``-o {creation,modification}, --order-by {creation,modification}`` | |
135 specify how result is sorted. with ``creation``, first created element is returned | |
136 first. There is no notion of *creation* of *modification* in original | |
137 `pubsub XEP <https://xmpp.org/extensions/xep-0060.html>`_, as publishing an item with an | |
138 existing id will overwrite the older one, creating a new item. With this option, we use | |
139 the terms defined in `XEP-0413 <https://xmpp.org/extensions/xep-0413.html>`_, and | |
140 *creation* time is the time when the first item has been published, before being | |
141 overwritten. | |
142 | |
143 In the case of ``modification``, if an item is overwritten, it reappears on top, this is | |
144 the default pubsub sorting order. | |
145 | |
146 progress | |
147 ======== | |
148 | |
149 This single option may be used when a long operation is happening, like a file transfer. | |
150 | |
151 ``-P, --progress`` | |
152 Show progress bar. | |
153 | |
154 verbose | |
155 ======= | |
156 | |
157 ``--verbose, -v`` | |
158 Add a verbosity level (can be used multiple times). Use to have more concise output by | |
159 default when it makes sense. | |
160 | |
3041
72583524cfd3
doc (jp): jp commands are now fully documented:
Goffi <goffi@goffi.org>
parents:
3021
diff
changeset
|
161 .. _draft_common: |
72583524cfd3
doc (jp): jp commands are now fully documented:
Goffi <goffi@goffi.org>
parents:
3021
diff
changeset
|
162 |
2946 | 163 draft |
164 ===== | |
165 | |
166 Common arguments used when an edition is potentially long to do, and a file may be kept | |
167 until publication. | |
168 | |
169 | |
170 ``-D, --current`` | |
171 Used when you have started to edit something (e.g. a blog post), which is not yet | |
172 published, and you want to continue your work. | |
173 | |
174 e.g.:: | |
175 | |
176 $ jp blog edit -D | |
177 | |
178 ``-F DRAFT_PATH, --draft-path DRAFT_PATH`` | |
179 Used when you have started to edit something and want to continue your work from this | |
180 file. In other words, it's similar to ``-D, --current`` except that you specify the file | |
181 to use instead of using the last available draft. | |
182 | |
3021
8ec35cf13f66
doc: added, overview, configuration and Primitivus documentation + some small modifications
Goffi <goffi@goffi.org>
parents:
2957
diff
changeset
|
183 .. _jp-output: |
8ec35cf13f66
doc: added, overview, configuration and Primitivus documentation + some small modifications
Goffi <goffi@goffi.org>
parents:
2957
diff
changeset
|
184 |
2946 | 185 output |
186 ====== | |
187 | |
188 Output is used when you want to get the result of the command in a specific way. It may be | |
189 used, for instance, to retrieve the result formatted in JSON so the data can be easily | |
190 manipulated by a script, or if you want only a specific element of the result. | |
191 | |
192 ``-O {…}, --output {…}`` | |
193 specifiy the output to use. Available options depends of the command you are using, | |
194 check ``jp [your command] --help`` to know them. | |
195 | |
196 e.g.:: | |
197 | |
198 $ jp blog get -O json | |
199 | |
200 ``--output-option OUTPUT_OPTS, --oo OUTPUT_OPTS`` | |
201 depending of the output selected, you may have options to customise the output. | |
202 For instance, if you use the ``template`` output, you may use an option to display the | |
203 result in a browser. | |
204 | |
205 e.g.:: | |
206 | |
207 $ jp blog | |
208 | |
209 Some options expect parameters, in this case they can be specified using ``=``. | |
210 | |
211 e.g. specifiying a template to use:: | |
212 | |
213 $ jp blog get -O template --oo browser --oo template=/tmp/my_template.html |