blob: 23e5ee7a902e02cefde8564e054b35dd5eb87a05 [file] [log] [blame]
Francis Lanielefb58002023-12-22 22:02:31 +01001.. SPDX-License-Identifier: GPL-2.0+
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: cli (command)
5
Francis Lanielefb58002023-12-22 22:02:31 +01006cli command
7===========
8
Heinrich Schuchardt44b09b32024-03-16 11:09:36 +01009Synopsis
10--------
Francis Lanielefb58002023-12-22 22:02:31 +010011
12::
13
14 cli get
15 cli set cli_flavor
16
17Description
18-----------
19
20The cli command permits getting and changing the current parser at runtime.
21
22cli get
23~~~~~~~
24
25It shows the current value of the parser used by the CLI.
26
27cli set
28~~~~~~~
29
30It permits setting the value of the parser used by the CLI.
31
Francis Laniel3b66e572023-12-22 22:02:32 +010032Possible values are old and modern.
Francis Lanielefb58002023-12-22 22:02:31 +010033Note that, to use a specific parser its code should have been compiled, that
34is to say you need to enable the corresponding CONFIG_HUSH*.
35Otherwise, an error message is printed.
36
37Examples
38--------
39
40Get the current parser::
41
42 => cli get
43 old
44
45Change the current parser::
46
Francis Laniel3b66e572023-12-22 22:02:32 +010047 => cli get
48 old
49 => cli set modern
50 => cli get
51 modern
Francis Lanielefb58002023-12-22 22:02:31 +010052 => cli set old
Francis Laniel3b66e572023-12-22 22:02:32 +010053 => cli get
54 old
Francis Lanielefb58002023-12-22 22:02:31 +010055
56Trying to set the current parser to an unknown value::
57
58 => cli set foo
59 Bad value for parser name: foo
60 cli - cli
61
62 Usage:
63 cli get - print current cli
Francis Laniel3b66e572023-12-22 22:02:32 +010064 set - set the current cli, possible values are: old, modern
65
66Trying to set the current parser to a correct value but its code was not
67compiled::
68
69 => cli get
70 modern
71 => cli set old
72 Want to set current parser to old, but its code was not compiled!
Francis Lanielefb58002023-12-22 22:02:31 +010073
74Return value
75------------
76
77The return value $? indicates whether the command succeeded.