Files
Giacomo Vercesi f626dece53 Add revng2 project dump-pipeline
Add the `revng2 project dump-pipeline` command which allows emitting the
pipeline description from the command-line.
2026-04-10 11:45:12 +02:00

20 lines
550 B
Python

#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
from typing import IO
import click
import yaml
from revng.pypeline.cli.context import ClickContext, pass_context
from revng.pypeline.utils.pipeline import get_pipeline_description
@click.command(hidden=True)
@click.option("-o", "--output", type=click.File("w"), default="-")
@pass_context
def dump_pipeline(ctx: ClickContext, output: IO[str]):
pipeline_description = get_pipeline_description(ctx.obj.pipeline)
yaml.safe_dump(pipeline_description, output)