Default values were fixed in the code. Moved to Kconfig to allow
customized configuration. Custom configuration may be used to prevent
line breaking injected on terminal width.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added special flag that can be used to indicate that optional
arguments are passed without any parsing (e.g. quotation marks
removal). Modified execute command to parse command line buffer
argument by argument.
After this change it is possible to forward whole command to
command handler (using select).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The "select" command has been implemented, which allows user to
narrow down the command tree.
This implementation differs from the "select" command available
in the legacy shell. In a new implementation, if the selected
command has a handler and if the user has not entered the
registered subcommand, the shell will call the handler of selected
command and pass the text as arguments.
This may be useful, for example, if someone wants to use the
shell as an interface to a modem that supports AT commands.
Instead of each time you write e.g:
at at+command1
at at+command2
at at+command3
user can execute following commands:
select at
at+command1
at+command2
at+command3
where:
at - root command for passing at commands to the modem
at+commandX - at command passed to the modem.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This change removes special handling for shell root commands.
Currently there is one loop in execute function that is used
to search commands on each level.
Fixed a bug where command buffer has been processed twice
when it was not needed (wildcards not found).
This change will allow to simplify "select" command
introduction.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Everywhere the return of this function was being assigned to u16_t to
save space on stack. Instead of casting in all these places (and may
end up with overflow), just changing this function's return.
Note that the function itself is not checking for overflow yet since
I'm not sure this can happen and/or is a problem. Though now we have
only one single point to fix this problem.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Removed shell_ prefix from static functions in .c files.
Added static functions for setting and getting shell
internal flags.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
shell parses output string and it adds \r for each found \n.
It is no longer needed to keep \r for each shell message.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
1. Created new shell module: shell_help.
2. Simplified command handlers with new shell print macros.
3. Removed help functions from command handlers.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
New shell support features like:
- multi-instance
- command tree
- static and dynamic commands
- multiline
- help print function
- smart tab (autocompletion)
- meta-keys
- history, wildcards etc.
- generic transport (initially, uart present)
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>