mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/3] hush: implement getopt builtin
Date: Mon, 11 Oct 2010 07:08:17 +0200	[thread overview]
Message-ID: <20101011050817.GE30252@game.jcrosoft.org> (raw)
In-Reply-To: <20101008124515.GP28242@pengutronix.de>

On 14:45 Fri 08 Oct     , Sascha Hauer wrote:
> On Fri, Oct 08, 2010 at 02:36:27PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 14:24 Fri 08 Oct     , Sascha Hauer wrote:
> > > Positional parameters are not nice, so implement a getopt
> > > function. This has to be done as a builtin because otherwise
> > > we have no access to the parents argc/argv.
> > > 
> > > getopt works as expected, here is a little example:
> > > 
> > > while getopt "hs:" OPT
> > > do
> > >         if [ $OPT = h ]; then
> > >                 echo "usage"
> > >                 exit 1
> > >         else
> > >                 echo "scr: opt: $OPT optarg: $OPTARG"
> > > 	fi
> > > done
> > > 
> > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > how about make it optional?
> 
> Probably a good idea. I just had in mind that we need to adjust
> the defconfigs then to still have a working defaultenv.
> 
> How about making it optional and combined with your defaultenv-Kconfig
> patch we could do a
> 
> 	select HUSH
> 	select HUSH_GETOPT
> 
> to make sure all commands needed by the defaultenv are in place.
that's why I move the defaultenv to Kconfig, I'm still in vacation. I'll send
the patch tomorrow

Best Regards,
J.

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

  reply	other threads:[~2010-10-11  5:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-08 12:24 Sascha Hauer
2010-10-08 12:24 ` [PATCH 1/3] hush: pass context around in shell Sascha Hauer
2010-10-08 12:24 ` [PATCH 2/3] hush: fix nasty memory leak in hush Sascha Hauer
2010-10-08 12:24 ` [PATCH 3/3] hush: implement getopt builtin Sascha Hauer
2010-10-08 12:36   ` Jean-Christophe PLAGNIOL-VILLARD
2010-10-08 12:45     ` Sascha Hauer
2010-10-11  5:08       ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2010-10-08 13:31   ` [PATCH 3/3 v2] " Sascha Hauer

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=20101011050817.GE30252@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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