Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

refactor commands #320

Merged
merged 1 commit into from
Dec 1, 2023
Merged

refactor commands #320

merged 1 commit into from
Dec 1, 2023

Conversation

PCSwingle
Copy link
Member

Refactors each command into a separate file. I don't like that we have to import each command in command/commands/init.py; feel free to suggest any better ideas.

Copy link
Member

@jakethekoenig jakethekoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One idea to avoid needing to import is to change the strange pattern where the commands register themselves when they're defined. We could do something similar to what we do for parsers:

  • Have an abstract command class with apply/argument_names/help_message. (like we do now without the class methods)
  • Have a dictionary mapping names to commands.

Approving because I think this is directionaly an improvement.

@PCSwingle PCSwingle merged commit ee04686 into main Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants