mirror of
https://github.com/sharkdp/bat
synced 2026-06-09 10:03:18 +00:00
Apply code changes: @orbisai0security can you address code review comm...
This commit is contained in:
+4
-3
@@ -4,6 +4,7 @@ import itertools
|
|||||||
import subprocess
|
import subprocess
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
|
from typing import Iterable
|
||||||
|
|
||||||
|
|
||||||
def generate_snapshots():
|
def generate_snapshots():
|
||||||
@@ -19,14 +20,14 @@ def generate_snapshots():
|
|||||||
|
|
||||||
|
|
||||||
def generate_style_snapshot(style):
|
def generate_style_snapshot(style):
|
||||||
generate_snapshot(style.replace(",", "_"), "--style={}".format(style))
|
generate_snapshot(style.replace(",", "_"), ["--style={}".format(style)])
|
||||||
|
|
||||||
|
|
||||||
def generate_snapshot(name, arguments):
|
def generate_snapshot(name: str, arguments: Iterable[str]):
|
||||||
output_file = "output/{name}.snapshot.txt".format(name=name)
|
output_file = "output/{name}.snapshot.txt".format(name=name)
|
||||||
command = [
|
command = [
|
||||||
"cargo", "run", "--", "--paging=never", "--color=never",
|
"cargo", "run", "--", "--paging=never", "--color=never",
|
||||||
"--decorations=always", arguments, "sample.rs"
|
"--decorations=always", *arguments, "sample.rs"
|
||||||
]
|
]
|
||||||
print("generating snapshot for {}".format(name))
|
print("generating snapshot for {}".format(name))
|
||||||
with open(output_file, "w") as f:
|
with open(output_file, "w") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user