* [PATCH 2/3] state command: extend help part I
2017-08-16 12:27 [PATCH 1/3] state: provide an error message when an error occurs Juergen Borleis
@ 2017-08-16 12:27 ` Juergen Borleis
2017-08-16 12:27 ` [PATCH 3/3] state command: extend help part II Juergen Borleis
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Juergen Borleis @ 2017-08-16 12:27 UTC (permalink / raw)
To: barebox
The loading parameter and its help text was removed in commit
446f3d07dd59f1b15b83a31fa88fba919ce4f47d and the loading parameter
was re-added in commit 3a5ddf3d0db006e9256c8e256e7dc7b4a3f89a14 but the
help was forgotten. Re-add the help as well.
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
commands/state.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/commands/state.c b/commands/state.c
index c57a906ff..038da402f 100644
--- a/commands/state.c
+++ b/commands/state.c
@@ -72,12 +72,13 @@ BAREBOX_CMD_HELP_TEXT("Usage: state [OPTIONS] [STATENAME]")
BAREBOX_CMD_HELP_TEXT("")
BAREBOX_CMD_HELP_TEXT("options:")
BAREBOX_CMD_HELP_OPT ("-s", "save state")
+BAREBOX_CMD_HELP_OPT ("-l", "load state")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(state)
.cmd = do_state,
- BAREBOX_CMD_DESC("save state information")
- BAREBOX_CMD_OPTS("[-s] [STATENAME]")
+ BAREBOX_CMD_DESC("load or save state information")
+ BAREBOX_CMD_OPTS("[-sl] [STATENAME]")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_state_help)
BAREBOX_CMD_END
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] state command: extend help part II
2017-08-16 12:27 [PATCH 1/3] state: provide an error message when an error occurs Juergen Borleis
2017-08-16 12:27 ` [PATCH 2/3] state command: extend help part I Juergen Borleis
@ 2017-08-16 12:27 ` Juergen Borleis
2017-08-17 8:05 ` [PATCH 1/3] state: provide an error message when an error occurs Uwe Kleine-König
2017-09-06 12:18 ` Sascha Hauer
3 siblings, 0 replies; 6+ messages in thread
From: Juergen Borleis @ 2017-08-16 12:27 UTC (permalink / raw)
To: barebox
Since commit 0c7436753c73e71ee512e5ed8029e7ccceedcd89 the 'state' command
supports authentification and a related parameter. Honor this in the help
text.
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
commands/state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/commands/state.c b/commands/state.c
index 038da402f..0dbca9f3b 100644
--- a/commands/state.c
+++ b/commands/state.c
@@ -73,12 +73,13 @@ BAREBOX_CMD_HELP_TEXT("")
BAREBOX_CMD_HELP_TEXT("options:")
BAREBOX_CMD_HELP_OPT ("-s", "save state")
BAREBOX_CMD_HELP_OPT ("-l", "load state")
+BAREBOX_CMD_HELP_OPT ("-n", "no authentication")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(state)
.cmd = do_state,
BAREBOX_CMD_DESC("load or save state information")
- BAREBOX_CMD_OPTS("[-sl] [STATENAME]")
+ BAREBOX_CMD_OPTS("[-sln] [STATENAME]")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_state_help)
BAREBOX_CMD_END
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] state: provide an error message when an error occurs
2017-08-16 12:27 [PATCH 1/3] state: provide an error message when an error occurs Juergen Borleis
2017-08-16 12:27 ` [PATCH 2/3] state command: extend help part I Juergen Borleis
2017-08-16 12:27 ` [PATCH 3/3] state command: extend help part II Juergen Borleis
@ 2017-08-17 8:05 ` Uwe Kleine-König
2017-08-17 8:16 ` Juergen Borleis
2017-09-06 12:18 ` Sascha Hauer
3 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2017-08-17 8:05 UTC (permalink / raw)
To: Juergen Borleis; +Cc: barebox
Hallo Jürgen,
On Wed, Aug 16, 2017 at 02:27:07PM +0200, Juergen Borleis wrote:
> A simple typo makes the state framework fail, but without an error
> message the developer is lost in the dark.
>
> Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
> ---
> common/state/state.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/common/state/state.c b/common/state/state.c
> index 121ba0c6d..fc822b21b 100644
> --- a/common/state/state.c
> +++ b/common/state/state.c
> @@ -240,6 +240,7 @@ static int state_convert_node_variable(struct state *state,
>
> vtype = state_find_type_by_name(type_name);
> if (!vtype) {
> + dev_dbg(&state->dev, "Error: invalid variable type '%s'\n", type_name);
I think this is only visible if you manually define DEBUG for state.
Assuming this is right dev_dbg doesn't match your intention.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] state: provide an error message when an error occurs
2017-08-17 8:05 ` [PATCH 1/3] state: provide an error message when an error occurs Uwe Kleine-König
@ 2017-08-17 8:16 ` Juergen Borleis
0 siblings, 0 replies; 6+ messages in thread
From: Juergen Borleis @ 2017-08-17 8:16 UTC (permalink / raw)
To: barebox; +Cc: Uwe Kleine-König
Hi Uwe,
On Thursday 17 August 2017 10:05:43 Uwe Kleine-König wrote:
> On Wed, Aug 16, 2017 at 02:27:07PM +0200, Juergen Borleis wrote:
> > A simple typo makes the state framework fail, but without an error
> > message the developer is lost in the dark.
> >
> > Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
> > ---
> > common/state/state.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/common/state/state.c b/common/state/state.c
> > index 121ba0c6d..fc822b21b 100644
> > --- a/common/state/state.c
> > +++ b/common/state/state.c
> > @@ -240,6 +240,7 @@ static int state_convert_node_variable(struct state
> > *state,
> >
> > vtype = state_find_type_by_name(type_name);
> > if (!vtype) {
> > + dev_dbg(&state->dev, "Error: invalid variable type '%s'\n", type_name);
>
> I think this is only visible if you manually define DEBUG for state.
> Assuming this is right dev_dbg doesn't match your intention.
My intention is to enlighten the developer when she/he adds the state feature
to her/his machine. Its not intended for the enduser (which means the
developer already has made a bad work). So the required "#define DEBUG" is
intended.
Jürgen
--
Pengutronix e.K. | Juergen Borleis |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] state: provide an error message when an error occurs
2017-08-16 12:27 [PATCH 1/3] state: provide an error message when an error occurs Juergen Borleis
` (2 preceding siblings ...)
2017-08-17 8:05 ` [PATCH 1/3] state: provide an error message when an error occurs Uwe Kleine-König
@ 2017-09-06 12:18 ` Sascha Hauer
3 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2017-09-06 12:18 UTC (permalink / raw)
To: Juergen Borleis; +Cc: barebox
On Wed, Aug 16, 2017 at 02:27:07PM +0200, Juergen Borleis wrote:
> A simple typo makes the state framework fail, but without an error
> message the developer is lost in the dark.
>
> Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
> ---
> common/state/state.c | 1 +
> 1 file changed, 1 insertion(+)
Applied, thanks
Sascha
>
> diff --git a/common/state/state.c b/common/state/state.c
> index 121ba0c6d..fc822b21b 100644
> --- a/common/state/state.c
> +++ b/common/state/state.c
> @@ -240,6 +240,7 @@ static int state_convert_node_variable(struct state *state,
>
> vtype = state_find_type_by_name(type_name);
> if (!vtype) {
> + dev_dbg(&state->dev, "Error: invalid variable type '%s'\n", type_name);
> ret = -ENOENT;
> goto out_free;
> }
> --
> 2.11.0
>
>
> _______________________________________________
> 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] 6+ messages in thread