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

shell/Kconfig: make config options usable with dependency resolution

This commit is contained in:
Martine Lenders 2021-02-17 17:10:51 +01:00
parent e740e75f1d
commit 561960769f
No known key found for this signature in database
GPG Key ID: CCD317364F63286F
2 changed files with 43 additions and 21 deletions

View File

@ -5,6 +5,19 @@
# directory for more details.
#
if !TEST_KCONFIG
menuconfig KCONFIG_USEMODULE_SHELL
bool "Configure the Shell interpreter"
depends on USEMODULE_SHELL
if KCONFIG_USEMODULE_SHELL
rsource "Kconfig.config"
endif # KCONFIG_USEMODULE_SHELL
endif # !TEST_KCONFIG
if TEST_KCONFIG
menuconfig MODULE_SHELL
bool "Shell interpreter"
select MODULE_STDIN
@ -12,25 +25,8 @@ menuconfig MODULE_SHELL
rsource "commands/Kconfig"
menuconfig KCONFIG_USEMODULE_SHELL
bool "Configure the Shell interpreter"
depends on USEMODULE_SHELL
if MODULE_SHELL
rsource "Kconfig.config"
endif
if KCONFIG_USEMODULE_SHELL
config SHELL_SHUTDOWN_ON_EXIT
bool "Shutdown RIOT on shell exit"
default y if HAS_CPU_NATIVE
help
Some systems (e.g Ubuntu 20.04) close stdin on CTRL-D / EOF
That means we can't just re-start the shell.
Instead terminate RIOT, which is also the behavior a user would expect
from a CLI application.
config SHELL_NO_ECHO
bool "Disable echo"
config SHELL_NO_PROMPT
bool "Disable prompt"
endif # KCONFIG_USEMODULE_SHELL
endif # TEST_KCONFIG

26
sys/shell/Kconfig.config Normal file
View File

@ -0,0 +1,26 @@
# Copyright (c) 2021 Freie Universität
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
# XXX This file only is required since there is no easy way to use these config
# options with both the final MODULE_SHELL and KCONFIG_USEMODULE_SHELL in a
# nicely looking and easy to migrate way. After migration, the content of this
# file can be folded back into `sys/shell/Kconfig`
config SHELL_SHUTDOWN_ON_EXIT
bool "Shutdown RIOT on shell exit"
default y if HAS_CPU_NATIVE
help
Some systems (e.g Ubuntu 20.04) close stdin on CTRL-D / EOF
That means we can't just re-start the shell.
Instead terminate RIOT, which is also the behavior a user would expect
from a CLI application.
config SHELL_NO_ECHO
bool "Disable echo"
config SHELL_NO_PROMPT
bool "Disable prompt"