Francis Laniel | efb5800 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
Heinrich Schuchardt | 1b0c316 | 2024-01-14 14:53:13 +0100 | [diff] [blame] | 3 | .. index:: |
| 4 | single: cli (command) |
| 5 | |
Francis Laniel | efb5800 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 6 | cli command |
| 7 | =========== |
| 8 | |
Heinrich Schuchardt | 44b09b3 | 2024-03-16 11:09:36 +0100 | [diff] [blame] | 9 | Synopsis |
| 10 | -------- |
Francis Laniel | efb5800 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 11 | |
| 12 | :: |
| 13 | |
| 14 | cli get |
| 15 | cli set cli_flavor |
| 16 | |
| 17 | Description |
| 18 | ----------- |
| 19 | |
| 20 | The cli command permits getting and changing the current parser at runtime. |
| 21 | |
| 22 | cli get |
| 23 | ~~~~~~~ |
| 24 | |
| 25 | It shows the current value of the parser used by the CLI. |
| 26 | |
| 27 | cli set |
| 28 | ~~~~~~~ |
| 29 | |
| 30 | It permits setting the value of the parser used by the CLI. |
| 31 | |
Francis Laniel | 3b66e57 | 2023-12-22 22:02:32 +0100 | [diff] [blame] | 32 | Possible values are old and modern. |
Francis Laniel | efb5800 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 33 | Note that, to use a specific parser its code should have been compiled, that |
| 34 | is to say you need to enable the corresponding CONFIG_HUSH*. |
| 35 | Otherwise, an error message is printed. |
| 36 | |
| 37 | Examples |
| 38 | -------- |
| 39 | |
| 40 | Get the current parser:: |
| 41 | |
| 42 | => cli get |
| 43 | old |
| 44 | |
| 45 | Change the current parser:: |
| 46 | |
Francis Laniel | 3b66e57 | 2023-12-22 22:02:32 +0100 | [diff] [blame] | 47 | => cli get |
| 48 | old |
| 49 | => cli set modern |
| 50 | => cli get |
| 51 | modern |
Francis Laniel | efb5800 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 52 | => cli set old |
Francis Laniel | 3b66e57 | 2023-12-22 22:02:32 +0100 | [diff] [blame] | 53 | => cli get |
| 54 | old |
Francis Laniel | efb5800 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 55 | |
| 56 | Trying 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 Laniel | 3b66e57 | 2023-12-22 22:02:32 +0100 | [diff] [blame] | 64 | set - set the current cli, possible values are: old, modern |
| 65 | |
| 66 | Trying to set the current parser to a correct value but its code was not |
| 67 | compiled:: |
| 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 Laniel | efb5800 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 73 | |
| 74 | Return value |
| 75 | ------------ |
| 76 | |
| 77 | The return value $? indicates whether the command succeeded. |