BoYanZh / Joint-Teapot

A handy and powerful tool for TAs in JI to handle works through Gitea, Canvas, and JOJ.
https://boyanzh.github.io/Joint-Teapot/
MIT License
18 stars 10 forks source link

feat: extend create-issues with --regex and --file #19

Closed fakefred closed 2 years ago

fakefred commented 2 years ago

This PR might be a bit controversial. In order not to break backward compatibility I abused boolean typer options to mimic one that takes an argument. For example,

joint_teapot create-issues --regex pgroup "title" --file issue.md

creates an illusion that pgroup is an argument to --regex and issue.md is to --file, but they are not. This command does the exact same thing:

joint_teapot create-issues pgroup "title" issue.md --file --regex

Obviously this is a hack, but (1) it gets the job done and (2) doesn't break userland. What do you think?

Thanks for reviewing.

BoYanZh commented 2 years ago

I think both solutions are acceptable, thanks.