omkarkhatavkar / jirasync

This CLI tool to sync and track GitHub issues, pr's, pr_reviews with Jira. Currently supported to only for create, update and close status.
MIT License
4 stars 3 forks source link

Simplify `cli.py` #21

Closed rochacbruno closed 5 years ago

rochacbruno commented 5 years ago

Currently cli.py has too many commands:

https://github.com/omkarkhatavkar/jirasync/blob/master/jirasync/cli.py

Commands:
  check-github-history  see github work history result based on intervals...
  redmine               Reads issues from redmine for users defined on...
  service-run           Run as a service/daemon based on `service` in...
  set-config            Set configuration in jirasync before start using it
  show-team-history     see github work history for a team based on...
  start-syncing         sync github issues, pr, pr_reviews as jira tasks
                        for...
  start-syncing-team    sync github issues, pr, pr_reviews as jira tasks
                        for...

My suggestion is to change it as:

Remove the commands:

Move the commands:

this way in the final we will end with only:

Commands:
    github                  Reads issues from github for users defined on...
    redmine               Reads issues from redmine for users defined on...
    run                       Run as a standalone script
    service-run           Run as a service/daemon based on `service` in...

examples of use:

jirasync redmine
# reads redmine, output report, check-only mode do not write
jirasync redmine --sync
# the same as above but writes the sync data to Jira

jirasync github
# reads github, output report, check-only mode do not write
jirasync github --sync
# the same as above but writes the sync data to Jira

jirasync run redmine,github 
# run both redmine and github in a single command, also accepts the `--sync` arg

jirasync service-run
# run as a daemon n a while loop