Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-27 Thread Simon Glass
Hi Mike, On Mon, Feb 27, 2012 at 10:32 AM, Mike Frysinger wrote: > On Monday 27 February 2012 00:43:30 Simon Glass wrote: >> On Sun, Feb 26, 2012 at 8:42 PM, Mike Frysinger wrote: >> > drivers/mtd/spi/sandbox.c: >> > static int sb_cmdline_cb_spi_sf(struct sandbox_state *state, const char >> > *ar

Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-27 Thread Mike Frysinger
On Monday 27 February 2012 00:43:30 Simon Glass wrote: > On Sun, Feb 26, 2012 at 8:42 PM, Mike Frysinger wrote: > > drivers/mtd/spi/sandbox.c: > > static int sb_cmdline_cb_spi_sf(struct sandbox_state *state, const char > > *arg) { > >unsigned long bus, cs; > >const char *spec = sb_spi_parse

Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-26 Thread Simon Glass
Hi Mike, On Sun, Feb 26, 2012 at 8:42 PM, Mike Frysinger wrote: > On Sunday 26 February 2012 23:33:25 Simon Glass wrote: >> On Sun, Feb 26, 2012 at 8:08 PM, Mike Frysinger wrote: >> > On Sunday 26 February 2012 21:50:32 Simon Glass wrote: >> >> Given your efforts on the cmdline parsing I'm beginn

Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-26 Thread Mike Frysinger
On Sunday 26 February 2012 23:33:25 Simon Glass wrote: > On Sun, Feb 26, 2012 at 8:08 PM, Mike Frysinger wrote: > > On Sunday 26 February 2012 21:50:32 Simon Glass wrote: > >> Given your efforts on the cmdline parsing I'm beginning to think we > >> should perhaps add os_printf() and os_printf_stder

Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-26 Thread Simon Glass
Hi Mike, On Sun, Feb 26, 2012 at 8:08 PM, Mike Frysinger wrote: > On Sunday 26 February 2012 21:50:32 Simon Glass wrote: >> Given your efforts on the cmdline parsing I'm beginning to think we >> should perhaps add os_printf() and os_printf_stderr() and provide an >> explicit interface. It might o

Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-26 Thread Mike Frysinger
On Sunday 26 February 2012 21:50:32 Simon Glass wrote: > Given your efforts on the cmdline parsing I'm beginning to think we > should perhaps add os_printf() and os_printf_stderr() and provide an > explicit interface. It might only be useful prior to main(), then > again I'm not so sure. i've been

Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-26 Thread Simon Glass
Hi Mike, On Sun, Feb 26, 2012 at 1:04 PM, Mike Frysinger wrote: > On Wednesday 15 February 2012 18:51:18 Simon Glass wrote: >> --- a/arch/sandbox/cpu/os.c >> +++ b/arch/sandbox/cpu/os.c >> >> +#include >> >> +void os_usage(int err) >> +{ >> +     if (err < 0) >> +             fprintf(stderr, "Tr

Re: [U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-26 Thread Mike Frysinger
On Wednesday 15 February 2012 18:51:18 Simon Glass wrote: > --- a/arch/sandbox/cpu/os.c > +++ b/arch/sandbox/cpu/os.c > > +#include > > +void os_usage(int err) > +{ > + if (err < 0) > + fprintf(stderr, "Try `--help' for more information.\n"); > + fprintf(err < 0 ? stderr : st

[U-Boot] [PATCH v4 8/8] sandbox: Add basic command line parsing

2012-02-15 Thread Simon Glass
This adds simple command-line parsing to sandbox. The idea is that it sets up the state with options provided, and this state can then be queried later, as needed. For now we just allow it to run a command. Passing a command to U-Boot on stdin is not as convenient IMO. The parsing code is in os.