DavidSpickett wrote:
> The logic is strained by checking } else if (args > 1 || ... ) {} in the
> second branch of the if, and then checking for 0 a little later on.
I've reorganised it so the first checks are the argument count, 0, 1, > 1, and
inside those, checking --all or parsing takes place. The diff isn't great, but
it should make sense when you view the whole file.
> eArgRepeatPlain, // Exactly one occurrence
This occurrence part does not appear to be enforced, seems to only apply to
help and usage output.
> So this command either has zero or 1 arguments. This gets checked by the
> CommandInterpreter, so the command doesn't need to handle anything but 0 or 1
> args.
So I had to keep the `argc > 1` part of the logic.
I could not find a way to automatically enforce that the command gets either
--all, or an address, and in which case there is only one address. The manual
validation should be a lot clearer now though.
https://github.com/llvm/llvm-project/pull/177176
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits