[PATCH] commands: ls: add ll as an alias for ls -l

Jan Luebbe jlu at pengutronix.de
Wed Jun 18 12:41:02 PDT 2014


This saves one second of user time on every interactive boot.

Signed-off-by: Jan Luebbe <jlu at pengutronix.de>
---
 commands/ls.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/commands/ls.c b/commands/ls.c
index 3440790..f8144ae 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -127,6 +127,9 @@ static int do_ls(int argc, char *argv[])
 	ulong flags = LS_COLUMN;
 	struct string_list sl;
 
+	if (!strcmp(argv[0], "ll"))
+		flags &= ~LS_COLUMN;
+
 	while((opt = getopt(argc, argv, "RCl")) > 0) {
 		switch(opt) {
 		case 'R':
@@ -219,3 +222,11 @@ BAREBOX_CMD_START(ls)
 	BAREBOX_CMD_GROUP(CMD_GRP_FILE)
 	BAREBOX_CMD_HELP(cmd_ls_help)
 BAREBOX_CMD_END
+
+BAREBOX_CMD_START(ll)
+	.cmd		= do_ls,
+	BAREBOX_CMD_DESC("list a file or directory with details")
+	BAREBOX_CMD_OPTS("[-lCR] [FILEDIR...]")
+	BAREBOX_CMD_GROUP(CMD_GRP_FILE)
+	BAREBOX_CMD_HELP(cmd_ls_help)
+BAREBOX_CMD_END
-- 
1.9.1




More information about the barebox mailing list