1X2GOOPTIONSSTRING(1) Unknown - X2Go Server Bug! X2GOOPTIONSSTRING(1)
2
3
4
6 x2gooptionsstring - X2Go Agent Options String Manipulator and Extractor
7
9 x2gooptionsstring --help|-h|-?
10 x2gooptionsstring --man
11 x2gooptionsstring [<--mode|-m><=| >t[ransform]|-t] [--compact|-c]
12 [--base64|-b] [--debug|-d] [--] options_string [+]|-key[=value] ...
13 x2gooptionsstring <--mode|-m><=| >e[xtract]|-e [--base64|-b]
14 [--debug|-d] [--] options_string key[=value] ...
15
17 x2gooptionsstring is a utility for manipulating and extracting data
18 from options strings as passed to X2Go/NX Agent. For more information
19 about supported options strings, refer to the OPTIONS STRINGS section
20 in the X2Go::Server::Agent::NX::Options documentation.
21
22 For full support of options string, which are allowed (but not
23 recommended) to include binary data, the special --base64|-b switch is
24 supported. If given, all arguments other than flags must be
25 base64-encoded (making it possible to pass binary data via shells, for
26 instance). The program's output, minus potentially debugging messages,
27 will also be base64-encoded.
28
29 Currently, two modes are supported:
30
31 Transform (default)
32 Transformation mode is enabled by default if no mode has been
33 explicitly selected.
34
35 Call this program with optional flags, the options string as the
36 first parameter and the transformations to be carried out as
37 additional parameters. At least one additional parameter (i.e., a
38 transformation) must be provided. Transformations are described
39 here briefly, but also in the TRANSFORMATIONS section in the
40 X2Go::Server::Agent::NX::Options documentation.
41
42 It can either add, remove or replace components.
43
44 To add or replace a component, pass key[=value] or +key[=value] as
45 a parameter. The latter syntax is useful if key starts with a dash
46 and would therefore be interpreted as a removal operation. If the
47 options string does not include a key key, it will be appended to
48 the end of the options string. If it already exists, either with
49 no value or a different value, the component will be replaced with
50 the provided value.
51
52 To fully remove a component, pass -key. To only remove it if it is
53 set to a specific value, pass -key=value.
54
55 Use the --compact option to minimize the original options string,
56 removing duplicated and empty entries.
57
58 Assuming no error happened, the resulting options string is written
59 to stdout.
60
61 Extract
62 Extraction mode must be explicitly requested using the -e or
63 <--mode|-m><=| >e[xtract] flags.
64
65 Call this program with optional flags, the options string as the
66 first parameter and key-value pairs to be extracted as additional
67 parameters. At least one additional parameter (i.e., a key-value
68 pair to extract) must be provided.
69
70 A degenerated key-value pair without an explicit value can be used
71 to test for the existence of a key and extract its value at the
72 same time.
73
74 A full, proper key-value pair can be used to test for the existence
75 of a key-value pair exactly as provided.
76
77 Assuming no error happened, the extracted key-value pairs will be
78 written to stdout. Each pair will be base64-encoded and, if
79 multiple key-value pairs to extract have been provided, delimited
80 via pipe characters ("|").
81
82 Key-value pairs which haven't been found in the original options
83 string, as well as potentially an empty key-value pair, will be
84 represented as empty fields.
85
86 Refer to the OPTIONS PARSING section for a description of when and how
87 to terminate options passed to this program.
88
90 --help|-?|-h
91 Print a brief help message and exits.
92
93 --man Prints the manual page and exits.
94
95 --debug|-d
96 Enables noisy debug output.
97
98 -t Shorthand for --mode=transform.
99
100 -e Shorthand for --mode=extract.
101
102 <--mode|-m><=| >mode string
103 Selects a specific program mode.
104
105 Currently, the following mode strings are supported:
106
107 • transform
108
109 • extract
110
111 Mode strings can be abbreviated, as long as the abbreviation is
112 uniquely selecting one mode exactly.
113
114 --compact|-c
115 Remove duplicate and empty entries after the initial parsing.
116 The order of arguments is preserved in a first-seen fashion.
117
118 This option is only available in transformation mode. It will
119 be silently ignored in extraction mode, as compaction is a pre-
120 requisite and done automatically during extraction.
121
122 --base64|-b
123 Enable a special full base64 mode.
124
125 Any binary data can be given and output by this program in this
126 mode, even when operating on a shell.
127
128 Input parameters must always be provided encoded in base64
129 form.
130
131 Likewise, the program will always output data encoded in a
132 base64 form. Since key-value pairs returned in extraction mode
133 are already base64-encoded and delimited with a character that
134 is not legal in the base64 encoding, this flag does not modify
135 the extraction's mode output (i.e., you will not have to decode
136 the output data twice).
137
138 OPTIONS PARSING
139 You can terminate program options parsing via a standard double-dash
140 (--) pseudo-option. It is highly recommended to always do so.
141
142 If you pass removal transformation operations or an extraction key-
143 value pair starts with a dash (-), passing the options terminator is
144 mandatory, even if no actual options are used. Otherwise,
145 transformation operations or extraction key-value pairs will be
146 interpreted as options to the program, which will almost certainly lead
147 to an error.
148
149 For example, passing "-clipboard" as a transformation operation without
150 a previous options terminator will be interpreted as the option "-c",
151 with the rest of the string modified into "-lipboard". Since this
152 program does not accept an option called "-l", it will terminate with
153 an error. Even if the program does not terminate with an error due to
154 an unknown option being supplied, a degradation into options is
155 certainly not what the original transformation operation was supposed
156 to represent.
157
159 TRANSFORMATIONS
160 For an options string such as
161
162 nx/nx,clipboard=both,foo:50
163
164 calling x2gooptionsstring '--' 'nx/nx,clipboard=both,foo:50'
165 '-clipboard' shall return
166
167 nx/nx,foo:50
168
169 while calling x2gooptionsstring '--' 'nx/nx,clipboard=both,foo:50'
170 '-clipboard=server' shall return
171
172 nx/nx,clipboard=both,foo:50
173
174 Calling "x2gooptionsstring '--' 'nx/nx,clipboard=both,foo:50' 'bar'"
175 shall return
176
177 nx/nx,clipboard=both,foo,bar:50
178
179 and calling x2gooptionsstring '--' 'nx/nx,clipboard=both,foo:50'
180 '+-bar' 'foo=gulp' '-clipboard=client' shall return
181
182 nx/nx,clipboard=both,foo=gulp,-bar:50
183
184 For an options string such as
185
186 nx/nx,clipboard=both,foo=bar,bar=baz,foo=oof:50
187
188 you can get a compacted version by cheating a bit and providing a
189 transformation which will certainly be a no-operation using
190 x2gooptionsstring '-c' '--'
191 'nx/nx,clipboard=both,foo=bar,bar=baz,,foo=oof,:50' '-', which shall
192 return
193
194 nx/nx,clipboard=both,foo=oof,bar=baz:50
195
196 EXTRACTIONS
197 For an options string such as
198
199 nx/nx,clipboard=both,foo=bar,-=-,,bar=baz,foo=oof:50
200
201 Calling x2gooptionsstring '-e' '--'
202 'nx/nx,clipboard=both,foo=bar,-=-,bar=baz,foo=oof,:50' 'foo' shall
203 return
204
205 Zm9vPW9vZg==
206
207 while calling x2gooptionsstring '-e' '--'
208 'nx/nx,clipboard=both,foo=bar,-=-,bar=baz,foo=oof,:50' 'bar' ''
209 'clipboard=none' '-' shall return
210
211 YmFyPWJheg==|||LT0t
212
214 This manual has been written by Mihai Moldovan <ionic@ionic.de>
215 <mailto:ionic@ionic.de> for the X2Go project (<https://www.x2go.org>).
216
217
218
219Version 4.1.0.4 2023-07-22 X2GOOPTIONSSTRING(1)