diff --git a/src/gitlogstats/__main__.py b/src/gitlogstats/__main__.py index b716c52..6c1c811 100644 --- a/src/gitlogstats/__main__.py +++ b/src/gitlogstats/__main__.py @@ -45,6 +45,9 @@ def main(): "--repository", help="the public URL of the repository whose logs to parse", ) + group.add_argument( + "-b", "--branch", help="the branch to parse", + ) group.add_argument( "-rf", "--repofile", @@ -136,6 +139,11 @@ def main(): ["git", "pull"], capture_output=True, check=True ) # clone the code from github + if args.branch: + subprocess.run( + ["git", "checkout", args.branch], capture_output=True, check=True + ) # clone the code from github + git_logs_parser = GitLogsParser( repo=repo_dir, start=args.start,