You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI plugin system introduced in #2438 is (to my mind ;) pretty nice - maybe we could refactor the sourmash CLI code to look like this more generally?
classCommand_XYZ(CommandLinePlugin):
command='xyz'description="does a thing"def__init__(self, subparser):
super().__init__(subparser)
# add argparse arguments here.debug_literal('RUNNING cmd_xyz.__init__')
defmain(self, args):
# code that we actually run.super().main(args)
print('RUNNING cmd', self, args)
The text was updated successfully, but these errors were encountered:
It is still pretty hard to use the Python API interactively, it was painful to use #2433 in the browser... I think this can fit what I was trying in #245 in a more general way (where we can share CLI/API code more easily, and expose to plugins too)
But I'm not sure how to do it technically. main(self, args) takes the results of argparse.ArgumentParser.parse_args. Is the idea that we would do a click-style expansion of the args?
I'm not sure how clean that would be, but I can try it out.
An alternative might be to add another method (execute? do? run?) to the class that would take the expanded arguments. But that seems like it would be uglier and require more manual work, be redundant, and cause errors. Hmm.
The CLI plugin system introduced in #2438 is (to my mind ;) pretty nice - maybe we could refactor the sourmash CLI code to look like this more generally?
The text was updated successfully, but these errors were encountered: