mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
Add --output option to save YAML results to a file
This commit is contained in:
parent
35503c0dff
commit
108df378aa
1 changed files with 14 additions and 2 deletions
|
@ -103,11 +103,17 @@ def main():
|
||||||
" successive tags"
|
" successive tags"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--output",
|
||||||
|
help="Output file to save the YAML results",
|
||||||
|
type=str,
|
||||||
|
default=None
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.all_since:
|
if args.all_since:
|
||||||
results = process_all_tags_since(args.start_tag)
|
results = process_all_tags_since(args.start_tag)
|
||||||
print(yaml.dump(results, sort_keys=False))
|
yaml_output = yaml.dump(results, sort_keys=False)
|
||||||
else:
|
else:
|
||||||
all_file_counts, grand_total, total_lines, aider_total, aider_percentage, end_date = blame(
|
all_file_counts, grand_total, total_lines, aider_total, aider_percentage, end_date = blame(
|
||||||
args.start_tag, args.end_tag
|
args.start_tag, args.end_tag
|
||||||
|
@ -127,7 +133,13 @@ def main():
|
||||||
"aider_percentage": round(aider_percentage, 2),
|
"aider_percentage": round(aider_percentage, 2),
|
||||||
}
|
}
|
||||||
|
|
||||||
print(yaml.dump(result, sort_keys=False))
|
yaml_output = yaml.dump(result, sort_keys=False)
|
||||||
|
|
||||||
|
if args.output:
|
||||||
|
with open(args.output, 'w') as f:
|
||||||
|
f.write(yaml_output)
|
||||||
|
else:
|
||||||
|
print(yaml_output)
|
||||||
|
|
||||||
|
|
||||||
def get_counts_for_file(start_tag, end_tag, authors, fname):
|
def get_counts_for_file(start_tag, end_tag, authors, fname):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue