Open evrose54 opened 1 month ago
This issue could potentially be handled in two steps.
usage
in the parsers and update the unit tests as appropriate to support the change.We might try getting 1
done before the workshop if we have time, but wait until after the workshop to address 2
.
Requested Update
Description
When reviewing PR #641, Jeremy was playing around with the usage statements and realized some of the
GeoipsTree
code didn't function as expected when the usage defaulted to argparse. For some reason, when using custom usage statements, only the command classes which inherit fromGeoipsExectuableCommand
have theirparser.prog
attribute changed to match exactly what that custom usage statement was.Per
argparse.ArgumentParser
documentation,parser.prog
should match exactly what was provided as the first argument that was not set as a keyword argument. Here's a simple example:However, for
GeoipsExecutableCommand
classes, theirparser.prog
attributes look like this:We couldn't track the source of this issue, and it's possible, though unlikely, that this could actually be a bug on argparse's side. We'll dive deeper into this after the tutorial, as this is a very weird problem that should be solved sooner rather than later.
Background and Motivation
This comes from the reviewal process of @jsolbrig in PR #641.
Alternative Solutions
Currently, we're going to leave this as is so we have stable functionality at the tutorial. However we expect to change the usage statements of the CLI in the future and will need to address this problem.
Code to demonstrate issue
Any CLI command class that inherits from
GeoipsExecutableCommand