Re: [PATCH v2.1] Introduce the "with" command

Pedro Alves
2019-06-22T11:48:24Z

On 6/22/19 11:30 AM, Philippe Waroquiers wrote:
> On Wed, 2019-06-19 at 18:20 +0100, Pedro Alves wrote:
>> Here's the updated full patch that incorporates the changes addressing
>> both Eli's and Philippe's comments.
> I quickly re-read the patch and did some trials.
>

Thanks!

> Two small remarks:
> * The tests related to "maint with" are failing.
> It looks like this patch misses the change
> "maint test-settings" to "maint set|show test-settings".

Hmm, with.exp and settings.exp both pass for me. Could you try the
users/palves/cli-options branch? It contains the latest version,
including the change below.

> * Maybe it would be worth expanding slightly the on-line help?
> What about:
>
> (gdb) help with
> Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING.
> Usage: with SETTING [VALUE] [-- COMMAND]
> Usage: w SETTING [VALUE] [-- COMMAND]
> With no COMMAND, repeats the last executed command.
>
> SETTING is any setting you can change with the "set" subcommands.
> Examples:
> Â  with language pascal -- print obj
> Â  with print elements unlimited -- print obj
> Â Â
> Multiple settings can be changed using nested with, and abbreviations
> can be used for commands and/or values.
> Example:
> Â  w la p -- w p el u -- p obj
> (gdb)Â

Sounds good to me, with a change to switch to active voice, to go
with the "changeable" -> "you can change" tweak in the previous round.

Like:

(gdb) help with
Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING.
Usage: with SETTING [VALUE] [-- COMMAND]
Usage: w SETTING [VALUE] [-- COMMAND]
With no COMMAND, repeats the last executed command.

SETTING is any setting you can change with the "set" subcommands.
E.g.:
with language pascal -- print obj
with print elements unlimited -- print obj

You can change multiple settings using nested with, and use
abbreviations for commands and/or values. E.g.:
w la p -- w p el u -- p obj
(gdb)

WDYT?

Thanks,
Pedro Alves