blob: a0cf5958fb9a6d48c1163635ae3ddda2475fa1d9 [file] [log] [blame]
Francis Lanielefb58002023-12-22 22:02:31 +01001.. SPDX-License-Identifier: GPL-2.0+
2
3cli command
4===========
5
6Synopis
7-------
8
9::
10
11 cli get
12 cli set cli_flavor
13
14Description
15-----------
16
17The cli command permits getting and changing the current parser at runtime.
18
19cli get
20~~~~~~~
21
22It shows the current value of the parser used by the CLI.
23
24cli set
25~~~~~~~
26
27It permits setting the value of the parser used by the CLI.
28
Francis Laniel3b66e572023-12-22 22:02:32 +010029Possible values are old and modern.
Francis Lanielefb58002023-12-22 22:02:31 +010030Note that, to use a specific parser its code should have been compiled, that
31is to say you need to enable the corresponding CONFIG_HUSH*.
32Otherwise, an error message is printed.
33
34Examples
35--------
36
37Get the current parser::
38
39 => cli get
40 old
41
42Change the current parser::
43
Francis Laniel3b66e572023-12-22 22:02:32 +010044 => cli get
45 old
46 => cli set modern
47 => cli get
48 modern
Francis Lanielefb58002023-12-22 22:02:31 +010049 => cli set old
Francis Laniel3b66e572023-12-22 22:02:32 +010050 => cli get
51 old
Francis Lanielefb58002023-12-22 22:02:31 +010052
53Trying to set the current parser to an unknown value::
54
55 => cli set foo
56 Bad value for parser name: foo
57 cli - cli
58
59 Usage:
60 cli get - print current cli
Francis Laniel3b66e572023-12-22 22:02:32 +010061 set - set the current cli, possible values are: old, modern
62
63Trying to set the current parser to a correct value but its code was not
64compiled::
65
66 => cli get
67 modern
68 => cli set old
69 Want to set current parser to old, but its code was not compiled!
Francis Lanielefb58002023-12-22 22:02:31 +010070
71Return value
72------------
73
74The return value $? indicates whether the command succeeded.