1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

43 Commits

Author SHA1 Message Date
Benjamin Valentin
f58384832c shell_lock: don't set CONFIG_SHELL_SHUTDOWN_ON_EXIT 2023-05-26 15:04:35 +02:00
5851db7c03
sys/shell_lock: model in Kconfig 2023-05-24 09:53:35 +02:00
Marian Buschsieweke
2825f5f2ae
sys/shell: use flash_utils 2023-02-27 12:31:03 +01:00
Karl Fessel
af8589059e sys/includes: replace kernel_defines.h 2022-11-22 13:39:35 +01:00
844fd52deb
sys/shell: remove deprecated SHELL_NO_{ECHO,PROMPT} defines 2022-01-07 13:23:52 +01:00
3eaa1beb56 sys/shell: initial XFA support 2021-03-02 14:57:29 +01:00
Leandro Lanzieri
8a29cf285d
sys/shell: fix menuconfig symbol name 2021-02-04 12:46:19 +01:00
Leandro Lanzieri
67f36d78a9
sys/shell: document configs and add to Kconfig 2021-02-04 09:19:43 +01:00
MrKevinWeiss
04630d20ba sys/shell: Add optional hooks for shell commands
Introduce optional user shell_post_readline_hook, shell_pre_command_hook, shell_post_command_hook.
Enable with USEMODULE=shell_hooks.
Calls user implemented *_hook functions if defined.
If implementation does not exist, nothing happens.

The intent is to make profiling of the shell command timings easier.

Test provided in tests/shell with USEMODULE=shell_hooks.
2020-07-07 17:00:38 +02:00
Benjamin Valentin
a6ca535955 sys/shell: native: stop RIOT when the shell reads EOF
Currently when the shell receives EOF on `native`, sending EOF
(ctrl + D) closes the stdin file descriptor, leading to all
consecutive reads to also return EOF.

The result is that `shell_run_forever()` will re-start the shell
forever in a loop, filling up the terminal with

    > > > > > > > > > > > > > > > > > > > > > > …

until the user hits ctrl + C.

This is annoying.

Instead, cleanly shutdown RIOT when receiving EOF on native, which
should match the expected behaviour of most users.
2020-06-30 14:52:53 +02:00
Martine S. Lenders
2c1a2863ce shell: make shell_run run shell forever
This change is in preparation to [PR 10788]. PR 10788 will make the
shell exitable which may lead to unexpected behavior in comparison to
previous usage of the shell.

To prevent this, this PR introduces two "new" functions to the shell's
API: `shell_run_once()` and `shell_run_forever()`.

`shell_run_once()` basically has the same behavior as `shell_run()` in
current master: Start a shell and continue reading lines until EOF is
reached.

`shell_run_forever()` wraps around `shell_run_once()` and restarts the
shell if it exits.

`shell_run()` is re-introduced as a back-porting alias for
`shell_run_forever()`.

As a consequence all current calls to `shell_run()` won't exit even
with [PR 10788] merged (which would add EOT as additional exit
condition for `shell_run_once()`).

[PR 10788]: https://github.com/RIOT-OS/RIOT/pull/10788
2019-09-19 10:26:31 +02:00
Lucas Jenss
62cecc9496 Do not try to continue reading shell commands if input source is closed
In RIOT native, sending CTRL+D to a shell started using shell_run would resulted in and
endless prompt loop. I've been unable to trigger such a behaviour
on actual hardware using a UART connection, but calling `pm_off` seemed
like a better alternative than having an `#ifdef BOARD_NATIVE`.

Fixes #9946
2018-10-30 19:06:42 +01:00
Laurent Navet
5fe337bc6c sys: fix include headers guards 2016-10-26 21:53:58 +02:00
Oleg Hahm
bdcf8879fd core: merged kernel_macros.h and attributes.h
Merged into new kernel_defines.h and updated all includes.
2016-03-09 22:29:06 +01:00
Lotte Steenbrink
9cfd2c5200 shell.h: fix tiny typo in documentation 2015-08-31 17:09:39 -07:00
13995e878f sys: shell: get rid of some parameters 2015-09-03 13:33:18 +02:00
Hauke Petersen
1eec484a30 sys/shell: changed signature of put_char pointer
changed from void(*put_char)(int) to int(*putchar)(int).

This is beneficial, as now the std-libs putchar can be given as
an argument to shell_init() directly.
2015-06-14 17:02:57 +02:00
kushalsingh007
9aae656be9 shell: Return-based error-handling for shell handlers
- Included the missing parts.
- Squashed with @authmillenon's commit
2015-03-25 23:54:04 +05:30
Hauke Petersen
2323c08d32 sys/shell: fixed and unified doxygen headers
- changed doxygen group name to sys_shell
- added some missing fields
- unified the doxygen header format
2015-03-03 18:10:06 +01:00
BytesGalore
de3c3cebd0 c++: sys: add extern C to header files 2014-11-08 20:09:55 +01:00
Ludwig Ortmann
b7992922ce fix license headers in non-.c files 2014-08-23 16:16:26 +02:00
Christian Mehlis
72036742d8 Merge pull request #1063 from Kijewski/shell_command_t-fix-const
shell: strings in shell_command_t are const
2014-04-28 14:07:36 +02:00
René Kijewski
07cc72576e shell: Comment internal members, too
Closes #979.
2014-04-28 10:41:48 +02:00
René Kijewski
4ed38bd2f3 shell: strings in shell_command_t are const 2014-04-27 14:37:54 +02:00
René Kijewski
14401ede42 shell: Add doxygen
Closes #577.
2014-04-22 08:03:15 +02:00
René Kijewski
c507632e50 Use argc and argv in shell handlers
Compare #708.

Now the tokenization of an input line is done by the shell itself. You
may quote arguments with `"..."`. Empty arguments, supplied by `""` are
preserved. Spaces in between arguments are squasheds; spaces inside
quotes are preserved.

You cannot partially quote an argument. You must not use
- `cmd "abc`,
- `cmd abc"def"`, or
- `cmd "abc"def`.
2014-02-25 17:54:17 +01:00
Christian Mehlis
cb9c5d00de repace project by application in documentation 2014-02-18 12:28:32 +01:00
Martin Lenders
68f7b9090e Make shell buffer size a shell property 2013-12-20 11:10:50 +01:00
Hauke Petersen
edcabf7cb6 Fixed a lot of comments by removing tabs and correcting format. 2013-12-16 14:00:33 +01:00
Hauke Petersen
3785fe956b Fixed doxygen comments, focused on file headers and group definitions 2013-12-16 14:00:24 +01:00
Ludwig Ortmann
d6c213fb47 fix grammar in license header 2013-11-23 13:11:56 +01:00
Christian Mehlis
84e73ae324 clean up shell 2013-11-14 10:45:24 +01:00
Christian Mehlis
bb85cb33d9 shell: dont't use malloc on each line 2013-11-14 10:45:24 +01:00
Oleg Hahm
6d130a45ac updated license headers
(No code changes!)
2013-08-16 10:20:23 +02:00
Oliver Hahm
5c52e1ce2e coding conventions for most of system libraries 2013-06-22 05:11:53 +02:00
Oleg Hahm
2277b366b2 * removed outdated occurrences of (u|µ)kleos and FeuerWare 2013-03-07 20:51:26 +01:00
Oliver Hahm
961b4df179 [core cib] [projects default] [sys shell]
* fixed some minor issues found by splint
2012-02-14 14:49:45 +01:00
07681a1914 * shell: added help,
* shell: fixed default shell commands
2010-11-04 15:05:51 +01:00
5a4524539d * misc shell improvements 2010-11-02 17:23:10 +01:00
59d72c7d6a * shell: removed hashmap dependency. shell is now O(n) 2010-10-01 15:24:43 +02:00
b8ca7edac8 * refactored uart / chardev handling 2010-09-30 15:10:39 +02:00
315f99af16 * shell fixes, refactoring 2010-09-28 13:39:59 +02:00
4c3e26d7d7 * added shell 2010-09-22 17:25:19 +02:00