Repository: microsoft/promptflow
File: src/promptflow-devkit/promptflow/_cli/_pf/_service.py (Python)

Code before:

def add_parser_start_service(subparsers):
    """Add service start parser to the pf service subparsers."""
    epilog = """
    Examples:

    # Start prompt flow service:
    pf service start
    # Force restart promptflow service:
    pf service start --force
    # Start promptflow service with specific port:
    pf service start --port 65553
    """  # noqa: E501
    add_param_port = lambda parser: parser.add_argument(  # noqa: E731
        "-p", "--port", type=int, help="port of the promptflow service"
    )
    add_param_force = lambda parser: parser.add_argument(  # noqa: E731
        "--force",
        action="store_true",
        help="If the port is used, the existing service will be terminated and restart a new service.",
    )
    add_param_debug = lambda parser: parser.add_argument(  # noqa: E731
        "-d",
        "--debug",
        action="store_true",
        help="The debug mode flag for the promptflow service activates foreground operation, displaying debug level "
        "logs directly in the terminal.",
    )
    activate_action(
        name="start",
        description="Start prompt flow service.",
        epilog=epilog,
        add_params=[
            add_param_port,
            add_param_force,
            add_param_debug,
        ]
        + [add_param_ua, add_param_verbose],
        subparsers=subparsers,
        help_message="Start prompt flow service.",
        action_param_name="sub_action",
    )


def add_parser_stop_service(subparsers):
    """Add service stop parser to the pf service subparsers."""
    epilog = """
    Examples:

    # Stop prompt flow service:
    pf service stop

Review comment (bug):
make it simpler: 

Start the promptflow service in foreground, displaying debug level logs directly in the terminal

Code after:

def add_parser_start_service(subparsers):
    """Add service start parser to the pf service subparsers."""
    epilog = """
    Examples:

    # Start prompt flow service:
    pf service start
    # Force restart prompt flow service:
    pf service start --force
    # Start prompt flow service with specific port:
    pf service start --port 65553
    """  # noqa: E501
    add_param_port = lambda parser: parser.add_argument(  # noqa: E731
        "-p", "--port", type=int, help="port of the prompt flow service"
    )
    add_param_force = lambda parser: parser.add_argument(  # noqa: E731
        "--force",
        action="store_true",
        help="If the port is used, the existing service will be terminated and restart a new service.",
    )
    add_param_debug = lambda parser: parser.add_argument(  # noqa: E731
        "-d",
        "--debug",
        action="store_true",
        help="Start the prompt flow service in foreground, displaying debug level logs directly in the terminal.",
    )
    activate_action(
        name="start",
        description="Start prompt flow service.",
        epilog=epilog,
        add_params=[
            add_param_port,
            add_param_force,
            add_param_debug,
        ]
        + [add_param_ua, add_param_verbose],
        subparsers=subparsers,
        help_message="Start prompt flow service.",
        action_param_name="sub_action",
    )


def add_parser_stop_service(subparsers):
    """Add service stop parser to the pf service subparsers."""
    epilog = """
    Examples:

    # Stop prompt flow service:
    pf service stop
    """  # noqa: E501