1818@click .option ("--exclude-pattern" , "-e" , multiple = True , help = "Patterns to exclude (space-separated patterns allowed)" )
1919@click .option ("--include-pattern" , "-i" , multiple = True , help = "Patterns to include (space-separated patterns allowed)" )
2020@click .option ("--ignore-file" , default = ".gitingestignore" , help = "Path to ignore file (default: .gitingestignore)" )
21+ @click .option ("--branch" , "-b" , default = None , help = "Branch to clone and ingest" )
2122def main (
2223 source : str ,
2324 output : str | None ,
2425 max_size : int ,
2526 exclude_pattern : tuple [str , ...],
2627 include_pattern : tuple [str , ...],
2728 ignore_file : str ,
29+ branch : str | None ,
2830):
2931 """
3032 Main entry point for the CLI.
@@ -44,8 +46,10 @@ def main(
4446 A tuple of patterns to include during the analysis. Only files matching these patterns will be processed.
4547 ignore_file : str
4648 Path to the ignore file containing additional patterns to exclude.
49+ branch : str | None
50+ The branch to clone (optional).
4751 """
48- asyncio .run (async_main (source , output , max_size , exclude_pattern , include_pattern , ignore_file ))
52+ asyncio .run (async_main (source , output , max_size , exclude_pattern , include_pattern , ignore_file , branch ))
4953
5054
5155async def async_main (
@@ -55,6 +59,7 @@ async def async_main(
5559 exclude_pattern : tuple [str , ...],
5660 include_pattern : tuple [str , ...],
5761 ignore_file : str ,
62+ branch : str | None ,
5863) -> None :
5964 """
6065 Analyze a directory or repository and create a text dump of its contents.
@@ -78,6 +83,8 @@ async def async_main(
7883 A tuple of patterns to include during the analysis. Only files matching these patterns will be processed.
7984 ignore_file : str
8085 Path to the ignore file containing additional patterns to exclude.
86+ branch : str | None
87+ The branch to clone (optional).
8188
8289 Raises
8390 ------
@@ -101,8 +108,8 @@ async def async_main(
101108 ignore_patterns = parse_ignore_file (ignore_file_path )
102109 exclude_patterns .update (ignore_patterns )
103110
104- # Perform the ingest operation
105- summary , * _ = await ingest (source , max_size , include_patterns , exclude_patterns , output = output )
111+ # Perform the ingest operation with branch support
112+ summary , * _ = await ingest (source , max_size , include_patterns , exclude_patterns , branch = branch , output = output )
106113
107114 # Display results
108115 click .echo (f"Analysis complete! Output written to: { output } " )
0 commit comments