mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] commands: ls: add ll as an alias for ls -l
@ 2014-06-18 19:41 Jan Luebbe
  2014-06-23  6:42 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Luebbe @ 2014-06-18 19:41 UTC (permalink / raw)
  To: barebox

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] commands: ls: add ll as an alias for ls -l
  2014-06-18 19:41 [PATCH] commands: ls: add ll as an alias for ls -l Jan Luebbe
@ 2014-06-23  6:42 ` Sascha Hauer
  2014-06-23  7:20   ` Holger Schurig
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2014-06-23  6:42 UTC (permalink / raw)
  To: Jan Luebbe; +Cc: barebox

On Wed, Jun 18, 2014 at 09:41:02PM +0200, Jan Luebbe wrote:
> This saves one second of user time on every interactive boot.
> 
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>

Applied, thanks

Sascha

> ---
>  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
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] commands: ls: add ll as an alias for ls -l
  2014-06-23  6:42 ` Sascha Hauer
@ 2014-06-23  7:20   ` Holger Schurig
  2014-06-23  7:44     ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Holger Schurig @ 2014-06-23  7:20 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Wouldn't it be better if barebox's shell gets the "alias" command?
This would solve a problem like this, and we also could get rid of one
of "edit"/"sedit" commands ...

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] commands: ls: add ll as an alias for ls -l
  2014-06-23  7:20   ` Holger Schurig
@ 2014-06-23  7:44     ` Sascha Hauer
  2014-06-23  8:02       ` Alexander Aring
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2014-06-23  7:44 UTC (permalink / raw)
  To: Holger Schurig; +Cc: barebox

On Mon, Jun 23, 2014 at 09:20:40AM +0200, Holger Schurig wrote:
> Wouldn't it be better if barebox's shell gets the "alias" command?
> This would solve a problem like this, and we also could get rid of one
> of "edit"/"sedit" commands ...

Why not? Send patches ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] commands: ls: add ll as an alias for ls -l
  2014-06-23  7:44     ` Sascha Hauer
@ 2014-06-23  8:02       ` Alexander Aring
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Aring @ 2014-06-23  8:02 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Mon, Jun 23, 2014 at 09:44:28AM +0200, Sascha Hauer wrote:
> On Mon, Jun 23, 2014 at 09:20:40AM +0200, Holger Schurig wrote:
> > Wouldn't it be better if barebox's shell gets the "alias" command?
> > This would solve a problem like this, and we also could get rid of one
> > of "edit"/"sedit" commands ...
> 
> Why not? Send patches ;)

I had the same idea some time ago... nobody replies. I never implement
anything. Sorry! :-)

- Alex

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-23  8:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18 19:41 [PATCH] commands: ls: add ll as an alias for ls -l Jan Luebbe
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox