mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-28 01:28:59 +00:00
nvram: add usage() function
Merge the help message into a single function, so that we can use it somewhere else. Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
This commit is contained in:
parent
1948d8e08c
commit
2a253e7cdb
@ -133,6 +133,18 @@ static int do_info(nvram_handle_t *nvram)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void usage(void)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Usage:\n"
|
||||||
|
" nvram show\n"
|
||||||
|
" nvram info\n"
|
||||||
|
" nvram get variable\n"
|
||||||
|
" nvram set variable=value [set ...]\n"
|
||||||
|
" nvram unset variable [unset ...]\n"
|
||||||
|
" nvram commit\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
int main( int argc, const char *argv[] )
|
int main( int argc, const char *argv[] )
|
||||||
{
|
{
|
||||||
@ -233,16 +245,7 @@ int main( int argc, const char *argv[] )
|
|||||||
}
|
}
|
||||||
else if( !done )
|
else if( !done )
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
usage();
|
||||||
"Usage:\n"
|
|
||||||
" nvram show\n"
|
|
||||||
" nvram info\n"
|
|
||||||
" nvram get variable\n"
|
|
||||||
" nvram set variable=value [set ...]\n"
|
|
||||||
" nvram unset variable [unset ...]\n"
|
|
||||||
" nvram commit\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
stat = 1;
|
stat = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user