xref: /aosp_15_r20/external/pigweed/pw_env_setup_zephyr/py/pw_env_setup_zephyr/argparser.py (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1#!/usr/bin/env python
2# Copyright 2024 The Pigweed Authors
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may not
5# use this file except in compliance with the License. You may obtain a copy of
6# the License at
7#
8#     https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations under
14# the License.
15"""Pigweed Zephyr argparser."""
16import argparse
17
18
19def add_parser_arguments(
20    parser: argparse.ArgumentParser,
21) -> argparse.ArgumentParser:
22    """Sets up an argument parser for pw zephyr."""
23    parser.add_argument(
24        '-v',
25        '--verbose',
26        dest='verbose',
27        action='store_true',
28        help="Enables debug logging",
29    )
30
31    subparsers = parser.add_subparsers(dest='zephyr_subcommand')
32    subparsers.add_parser(
33        'manifest',
34        help=(
35            'Prints the West manifest entries needed to add this Pigweed'
36            ' instance'
37        ),
38    )
39
40    return parser
41