summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-05-01 21:41:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-01 21:41:59 +0200
commite4e3fbd22bca38f10f1cd7a3f5eb75e0b265dcaa (patch)
treefc713ed2e9b4ed774bc4dda9521dcb7ff867e2dd /commands
parent8ca42643d4a3a15d4802f93d1433e640b846df04 (diff)
parent9492976bc88a9fe4633202681fcdc24ce1dab636 (diff)
downloadbarebox-e4e3fbd22bca38f10f1cd7a3f5eb75e0b265dcaa.tar.gz
barebox-e4e3fbd22bca38f10f1cd7a3f5eb75e0b265dcaa.tar.xz
Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into next
improve complete support The following patch serie improve the complete support by adding a complete framework to allow commands complete support. The add also car complete support for eval and setting and executable file support This also include an update of the stringlist API to support asprintf API
Diffstat (limited to 'commands')
-rw-r--r--commands/clear.c2
-rw-r--r--commands/false.c2
-rw-r--r--commands/go.c2
-rw-r--r--commands/help.c2
-rw-r--r--commands/login.c2
-rw-r--r--commands/lsmod.c2
-rw-r--r--commands/meminfo.c2
-rw-r--r--commands/net.c2
-rw-r--r--commands/partition.c2
-rw-r--r--commands/passwd.c2
-rw-r--r--commands/pwd.c2
-rw-r--r--commands/reginfo.c2
-rw-r--r--commands/reset.c2
-rw-r--r--commands/sleep.c2
-rw-r--r--commands/true.c2
-rw-r--r--commands/usb.c2
-rw-r--r--commands/version.c2
17 files changed, 34 insertions, 0 deletions
diff --git a/commands/clear.c b/commands/clear.c
index 9e5da10d4f..28b4da9661 100644
--- a/commands/clear.c
+++ b/commands/clear.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <readkey.h>
static int do_clear(int argc, char *argv[])
@@ -39,4 +40,5 @@ BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(clear)
.cmd = do_clear,
.usage = "clear screen",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/false.c b/commands/false.c
index 6ba3823229..1642f8de15 100644
--- a/commands/false.c
+++ b/commands/false.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
static int do_false(int argc, char *argv[])
{
@@ -32,5 +33,6 @@ static int do_false(int argc, char *argv[])
BAREBOX_CMD_START(false)
.cmd = do_false,
.usage = "do nothing, unsuccessfully",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/go.c b/commands/go.c
index c821207a6f..e9e9d40dbe 100644
--- a/commands/go.c
+++ b/commands/go.c
@@ -25,6 +25,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <fs.h>
#include <fcntl.h>
#include <linux/ctype.h>
@@ -91,4 +92,5 @@ BAREBOX_CMD_START(go)
.cmd = do_go,
.usage = "start application at address or file",
BAREBOX_CMD_HELP(cmd_go_help)
+ BAREBOX_CMD_COMPLETE(cammand_var_complete)
BAREBOX_CMD_END
diff --git a/commands/help.c b/commands/help.c
index 706b9057e9..d7d9ba25af 100644
--- a/commands/help.c
+++ b/commands/help.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
/*
* Use puts() instead of printf() to avoid printf buffer overflow
@@ -68,5 +69,6 @@ BAREBOX_CMD_START(help)
.aliases = help_aliases,
.usage = "print online help",
BAREBOX_CMD_HELP(cmd_help_help)
+ BAREBOX_CMD_COMPLETE(command_complete)
BAREBOX_CMD_END
diff --git a/commands/login.c b/commands/login.c
index 2f3d7668d5..0b5f3cbb4a 100644
--- a/commands/login.c
+++ b/commands/login.c
@@ -20,6 +20,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <password.h>
#include <getopt.h>
@@ -80,4 +81,5 @@ BAREBOX_CMD_START(login)
.cmd = do_login,
.usage = "login",
BAREBOX_CMD_HELP(cmd_login_help)
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/lsmod.c b/commands/lsmod.c
index f7da1d01ef..e54eadc2ff 100644
--- a/commands/lsmod.c
+++ b/commands/lsmod.c
@@ -1,5 +1,6 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <module.h>
static int do_lsmod(int argc, char *argv[])
@@ -15,4 +16,5 @@ static int do_lsmod(int argc, char *argv[])
BAREBOX_CMD_START(lsmod)
.cmd = do_lsmod,
.usage = "list modules",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/meminfo.c b/commands/meminfo.c
index b41274439d..1d24cfdb3c 100644
--- a/commands/meminfo.c
+++ b/commands/meminfo.c
@@ -21,6 +21,7 @@
*/
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <malloc.h>
static int do_meminfo(int argc, char *argv[])
@@ -33,4 +34,5 @@ static int do_meminfo(int argc, char *argv[])
BAREBOX_CMD_START(meminfo)
.cmd = do_meminfo,
.usage = "print info about memory usage",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/net.c b/commands/net.c
index c5c6373dd3..a453f4ed33 100644
--- a/commands/net.c
+++ b/commands/net.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <environment.h>
#include <driver.h>
#include <net.h>
@@ -96,5 +97,6 @@ BAREBOX_CMD_START(ethact)
.cmd = do_ethact,
.usage = "set current ethernet device",
BAREBOX_CMD_HELP(cmd_ethact_help)
+ BAREBOX_CMD_COMPLETE(eth_complete)
BAREBOX_CMD_END
diff --git a/commands/partition.c b/commands/partition.c
index 4892261885..6cce0423d3 100644
--- a/commands/partition.c
+++ b/commands/partition.c
@@ -32,6 +32,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <driver.h>
#include <malloc.h>
#include <partition.h>
@@ -225,5 +226,6 @@ BAREBOX_CMD_START(delpart)
.cmd = do_delpart,
.usage = "delete partition(s)",
BAREBOX_CMD_HELP(cmd_delpart_help)
+ BAREBOX_CMD_COMPLETE(devfs_partition_complete)
BAREBOX_CMD_END
diff --git a/commands/passwd.c b/commands/passwd.c
index cdbcdf540f..7f704ad454 100644
--- a/commands/passwd.c
+++ b/commands/passwd.c
@@ -20,6 +20,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <password.h>
#include <errno.h>
@@ -95,4 +96,5 @@ BAREBOX_CMD_START(passwd)
.cmd = do_passwd,
.usage = "passwd",
BAREBOX_CMD_HELP(cmd_passwd_help)
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/pwd.c b/commands/pwd.c
index 4afe2d4a49..d68a509f78 100644
--- a/commands/pwd.c
+++ b/commands/pwd.c
@@ -21,6 +21,7 @@
*/
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <fs.h>
static int do_pwd(int argc, char *argv[])
@@ -32,4 +33,5 @@ static int do_pwd(int argc, char *argv[])
BAREBOX_CMD_START(pwd)
.cmd = do_pwd,
.usage = "print working directory",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/reginfo.c b/commands/reginfo.c
index 009a065a2d..a31013a664 100644
--- a/commands/reginfo.c
+++ b/commands/reginfo.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
static int do_reginfo(int argc, char *argv[])
{
@@ -32,4 +33,5 @@ static int do_reginfo(int argc, char *argv[])
BAREBOX_CMD_START(reginfo)
.cmd = do_reginfo,
.usage = "print register information",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/reset.c b/commands/reset.c
index 9f242d12c1..97d04eed13 100644
--- a/commands/reset.c
+++ b/commands/reset.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
static int cmd_reset(int argc, char *argv[])
{
@@ -34,4 +35,5 @@ static int cmd_reset(int argc, char *argv[])
BAREBOX_CMD_START(reset)
.cmd = cmd_reset,
.usage = "Perform RESET of the CPU",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/sleep.c b/commands/sleep.c
index f772e87a0d..c5f7867400 100644
--- a/commands/sleep.c
+++ b/commands/sleep.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <clock.h>
static int do_sleep(int argc, char *argv[])
@@ -46,4 +47,5 @@ static int do_sleep(int argc, char *argv[])
BAREBOX_CMD_START(sleep)
.cmd = do_sleep,
.usage = "delay execution for n seconds",
+ BAREBOX_CMD_COMPLETE(cammand_var_complete)
BAREBOX_CMD_END
diff --git a/commands/true.c b/commands/true.c
index 773ddef8a7..e50152ff57 100644
--- a/commands/true.c
+++ b/commands/true.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
static int do_true(int argc, char *argv[])
{
@@ -32,5 +33,6 @@ static int do_true(int argc, char *argv[])
BAREBOX_CMD_START(true)
.cmd = do_true,
.usage = "do nothing, successfully",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/usb.c b/commands/usb.c
index e28afd051b..d02ea4b0f7 100644
--- a/commands/usb.c
+++ b/commands/usb.c
@@ -21,6 +21,7 @@
*/
#include <common.h>
#include <command.h>
+#include <complete.h>
#include <usb/usb.h>
#include <getopt.h>
@@ -56,4 +57,5 @@ BAREBOX_CMD_START(usb)
.cmd = do_usb,
.usage = "(re-)detect USB devices",
BAREBOX_CMD_HELP(cmd_usb_help)
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/version.c b/commands/version.c
index 8901faea68..6dbda7aade 100644
--- a/commands/version.c
+++ b/commands/version.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <command.h>
+#include <complete.h>
static int do_version(int argc, char *argv[])
{
@@ -33,5 +34,6 @@ static int do_version(int argc, char *argv[])
BAREBOX_CMD_START(version)
.cmd = do_version,
.usage = "print monitor version",
+ BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END