https://github.com/clayborg commented:

I like this idea. Since python is so dynamic, I wonder if we can just add extra 
metadata to the standard "argparse" objects so that users can just write their 
stuff in the most pythonic way possible using `import argparse` and then adding 
some extra metadata that lldb can access. For example something like:

```
$ python3
Python 3.8.9 (default, Jul 27 2021, 02:53:04) 
[Clang 7.1.0 (tags/RELEASE_710/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
>>> ap = argparse.ArgumentParser()
>>> v = ap.add_argument('-v')
>>> print(v)
_StoreAction(option_strings=['-v'], dest='v', nargs=None, const=None, 
default=None, type=None, choices=None, help=None, metavar=None)
>>> print(type(v))
<class 'argparse._StoreAction'>
>>> v.lldb_type = lldb.eArgTypeBoolean
>>> v.lldb_type
lldb.eArgTypeBoolean
```
Then users can use the standard `argparse` module and just add a bit of extra 
metadata to it that LLDB can then access when needed. This would remove the 
need for a custom LLDBOVParser class.


https://github.com/llvm/llvm-project/pull/70734
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to