Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Commit

Permalink
[#10] issues/copy: documentation of feature (#11)
Browse files Browse the repository at this point in the history
* readme: add `copy` to list of tools

* ctrl/issues: improve helptext for `copy` tool
  • Loading branch information
Skaty authored Apr 5, 2018
1 parent 17fedd5 commit 5c700e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $ python main.py [group] [tool] [tool-parameters ...|-h]

* `issues` -- Issue Management Tools
* `blast` -- Create duplicated issues for a list of GitHub users
* `copy` -- Duplicate issues from one GitHub repository to another
* `orgs` -- GitHub Organisation Management Tools
* `mass-add` -- Invite a list of users to join a particular organisation

Expand Down
16 changes: 12 additions & 4 deletions controllers/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .common import BaseController
import parsers

import logging, re, time, sys
import argparse, logging, re, time, sys

class IssueController(BaseController):
def __init__(self, ghc):
Expand Down Expand Up @@ -32,11 +32,19 @@ def setup_blast_args(self, subparsers):
parser.set_defaults(func=self.blast_command)

def setup_copy_args(self, subparsers):
parser = subparsers.add_parser('copy', help='copies issues from one repository to another')
help_text = 'copies issues from one repository to another'
example_text = '''example:
python main.py octocat/source octocat/destination
python main.py -m mymapping.csv octocat/source octocat/destination
python main.py -m mymapping.csv octocat/source octo{}/destination'''
parser = subparsers.add_parser('copy',
help=help_text,
epilog=example_text,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('fromrepo', metavar='from', type=str,
help='repository from which we should copy')
help='repository to copy from, in {owner}/{name} format')
parser.add_argument('torepo', metavar='to', type=str,
help='repository to which we should copy to')
help='repository to copy from, in {owner}/{name} format. If a replacement field ({}) is specified, it will be replaced with the first tag in the mapping.')
parser.add_argument('-m', '--mapping', metavar='csv', type=str,
help='filename of CSV containing the title tag mapping')
parser.add_argument('-s', '--start-from', metavar='index', type=int,
Expand Down

0 comments on commit 5c700e3

Please sign in to comment.