Add TOYBOX_PEDANTIC_ARGS to check arguments when there are no arguments,
and make uptime use it.
This commit is contained in:
parent
2ba9c414e0
commit
cb8e5ad6c5
@ -135,6 +135,12 @@ config TOYBOX_DEBUG
|
||||
Enable extra checks for debugging purposes. All of them catch
|
||||
things that can only go wrong at development time, not runtime.
|
||||
|
||||
config TOYBOX_PEDANTIC_ARGS
|
||||
bool "Pedantic argument checking"
|
||||
default n
|
||||
help
|
||||
Check arguments for commands that have no arguments.
|
||||
|
||||
config TOYBOX_UID_SYS
|
||||
int "First system UID"
|
||||
default 100
|
||||
|
@ -28,3 +28,9 @@
|
||||
|
||||
// Suppress default --help processing
|
||||
#define TOYFLAG_NOHELP (1<<9)
|
||||
|
||||
#if CFG_TOYBOX_PEDANTIC_ARGS
|
||||
#define NO_ARGS ">0"
|
||||
#else
|
||||
#define NO_ARGS 0
|
||||
#endif
|
||||
|
@ -182,6 +182,7 @@ make_flagsh()
|
||||
else
|
||||
$SED '/USE_.*([^)]*)$/s/$/ __VA_ARGS__/' generated/config.h
|
||||
fi
|
||||
echo '#include "lib/toyflags.h"'
|
||||
cat generated/newtoys.h
|
||||
|
||||
# Run result through preprocessor, glue together " " gaps leftover from USE
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Copyright 2013 Jeroen van Rijn <jvrnix@gmail.com>
|
||||
|
||||
|
||||
USE_UPTIME(NEWTOY(uptime, NULL, TOYFLAG_USR|TOYFLAG_BIN))
|
||||
USE_UPTIME(NEWTOY(uptime, NO_ARGS, TOYFLAG_USR|TOYFLAG_BIN))
|
||||
|
||||
config UPTIME
|
||||
bool "uptime"
|
||||
|
Loading…
Reference in New Issue
Block a user