@@ -20,6 +20,7 @@ def cli():
2020 default = "CHANGELOG.md" ,
2121 type = click .Path (exists = True , file_okay = True , dir_okay = False ),
2222 show_default = True ,
23+ envvar = "CR_CHANGELOG" ,
2324)
2425@click .option ("--tag-prefix" , default = "v" , show_default = True , envvar = "CR_TAG_PREFIX" )
2526@click .option ("--no-tag-prefix" , default = False , is_flag = True , envvar = "CR_NO_TAG_PREFIX" )
@@ -29,8 +30,9 @@ def cli():
2930 envvar = "GITHUB_API_URL" ,
3031 default = "https://api.github.com" ,
3132)
33+ @click .option ("--limit" , default = - 1 , envvar = "CR_LIMIT" )
3234@click .option ("--token" , envvar = "GITHUB_TOKEN" , required = True )
33- def sync (changelog , tag_prefix , no_tag_prefix , repo , api_url , token ):
35+ def sync (changelog , tag_prefix , no_tag_prefix , repo , api_url , limit , token ):
3436 if no_tag_prefix :
3537 tag_prefix = ""
3638
@@ -48,7 +50,12 @@ def sync(changelog, tag_prefix, no_tag_prefix, repo, api_url, token):
4850
4951 results = []
5052
51- for version in cl .versions :
53+ versions = cl .versions
54+ if limit > - 1 :
55+ click .echo (f"Limiting to { limit } of { len (versions )} versions" )
56+ versions = versions [:limit ]
57+
58+ for version in versions :
5259 click .secho (f"\n Syncing version { version } " , bold = True )
5360 version_contents = cl .parse_version_content (version )
5461
0 commit comments