MonkeyCanCode commented on code in PR #2154:
URL: https://github.com/apache/polaris/pull/2154#discussion_r2224227690
##########
client/python/cli/options/parser.py:
##########
@@ -57,22 +57,24 @@ class Parser(object):
),
Argument(Arguments.PROFILE, str, hint="profile for token-based
authentication"),
Argument(Arguments.PROXY, str, hint="proxy URL"),
+ Argument(Arguments.DEBUG, bool, hint="Enable debug mode"),
]
@staticmethod
def _build_parser() -> argparse.ArgumentParser:
parser = TreeHelpParser(description="Polaris CLI")
for arg in Parser._ROOT_ARGUMENTS:
+ kwargs = {"help": arg.hint}
if arg.default is not None:
- parser.add_argument(
Review Comment:
that is correct, the above only change for the root one as it is the one
that is enforcing everything to have an value for a given argument. The
non-root arguments should work with following:
```
if arg.type is bool:
del kwargs['type']
parser.add_argument(arg.get_flag_name(), **kwargs,
action='store_true')
````
E.g.
```
➜ polaris git:(python_client_debug_flag) ✗ ./polaris --profile dev
privileges catalog revoke --catalog quickstart_catalog --catalog-role
quickstart_catalog_role --cascade CATALOG_MANAGE_CONTENT
Exception when communicating with the Polaris server. 501: Not Implemented
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]