code: def add_parser(subparsers, parent_parser):
      DAG_HELP = "Visualize DVC project DAG."
      dag_parser = subparsers.add_parser(
          "dag",
          parents=[parent_parser],
          description=append_doc_link(DAG_HELP, "dag"),
          help=DAG_HELP,
          formatter_class=formatter.RawDescriptionHelpFormatter,
      )
      dag_parser.add_argument(
          "--dot",
          action="store_true",
          default=False,
          help="Print DAG with .dot format.",
      )
      dag_parser.add_argument(
          "--mermaid",
          action="store_true",
          default=False,
          help="Print DAG with mermaid format.",
      )
      dag_parser.add_argument(
          "--md",
          action="store_true",
          default=False,
          dest="markdown",
          help="Print DAG with mermaid format wrapped in Markdown block.",
      )
      dag_parser.add_argument(
          "--full",
          action="store_true",
          default=False,
          help=(
              "Show full DAG that the target belongs too, instead of "
              "showing DAG consisting only of ancestors."
          ),
      )
      dag_parser.add_argument(
          "-o",
          "--outs",
          action="store_true",
          default=False,
          help="Print output files instead of stages.",
      )
      dag_parser.add_argument(
          "target",
          nargs="?",
          help=(
              "Stage name or output to show pipeline for. "
              "Finds all stages in the workspace by default."
          ),
      )
      dag_parser.set_defaults(func=CmdDAG)
  
file_path: dvc/dvc/commands/dag.py
imports: from typing import TYPE_CHECKING
  from dvc.cli import formatter
  from dvc.cli.command import CmdBase
  from dvc.cli.utils import append_doc_link
  from dvc.ui import ui
label_desc: Use image node_id 9 for calling a global function with example usage: add_parser(subparsers, parent_parser) without return types