summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-10-18 14:36:49 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-10-18 22:45:32 +0200
commiteca7871bced78837154ad52c42864ba3c87a9904 (patch)
treed6ad489173bde58cef1c41c8f01f2698fa661343 /commands
parent57aac5f1ff63b4997d3dc665c4c05f5470a1e681 (diff)
downloadbarebox-eca7871bced78837154ad52c42864ba3c87a9904.tar.gz
barebox-eca7871bced78837154ad52c42864ba3c87a9904.tar.xz
complete: Add completion for nv and globalvar commands
The 'nv' command is often used to create a nv variable for an existing global variable, so add a command completion function for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/global.c2
-rw-r--r--commands/nv.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/commands/global.c b/commands/global.c
index d21b82951c..fc687169a7 100644
--- a/commands/global.c
+++ b/commands/global.c
@@ -22,6 +22,7 @@
#include <globalvar.h>
#include <environment.h>
#include <getopt.h>
+#include <complete.h>
static int do_global(int argc, char *argv[])
{
@@ -77,4 +78,5 @@ BAREBOX_CMD_START(global)
BAREBOX_CMD_OPTS("[-r] VAR[=VALUE] ...")
BAREBOX_CMD_GROUP(CMD_GRP_ENV)
BAREBOX_CMD_HELP(cmd_global_help)
+ BAREBOX_CMD_COMPLETE(nv_global_complete)
BAREBOX_CMD_END
diff --git a/commands/nv.c b/commands/nv.c
index a1fb095a16..37cdb96647 100644
--- a/commands/nv.c
+++ b/commands/nv.c
@@ -22,6 +22,7 @@
#include <globalvar.h>
#include <environment.h>
#include <getopt.h>
+#include <complete.h>
static int do_nv(int argc, char *argv[])
{
@@ -90,4 +91,5 @@ BAREBOX_CMD_START(nv)
BAREBOX_CMD_OPTS("[-r] VAR[=VALUE] ...")
BAREBOX_CMD_GROUP(CMD_GRP_ENV)
BAREBOX_CMD_HELP(cmd_nv_help)
+ BAREBOX_CMD_COMPLETE(nv_global_complete)
BAREBOX_CMD_END