From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] commands: ls: add ll as an alias for ls -l
Date: Wed, 18 Jun 2014 21:41:02 +0200 [thread overview]
Message-ID: <1403120463-24005-1-git-send-email-jlu@pengutronix.de> (raw)
This saves one second of user time on every interactive boot.
Signed-off-by: Jan Luebbe <jlu@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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2014-06-18 19:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 19:41 Jan Luebbe [this message]
2014-06-23 6:42 ` Sascha Hauer
2014-06-23 7:20 ` Holger Schurig
2014-06-23 7:44 ` Sascha Hauer
2014-06-23 8:02 ` Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403120463-24005-1-git-send-email-jlu@pengutronix.de \
--to=jlu@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox