scripts: west_commands: fix type of path options

Using `west patch` with the `--patch-base`, `--patch-yaml` or
`--west-workspace` option results in an unhandled AttributeError in
filter_args() because the function expects these args to be of type
path. Adding the type to the argument definition forces argparse to
create variables of type path.

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
This commit is contained in:
Gerhard Jörges 2025-01-03 10:45:57 +01:00 committed by Fabio Baltieri
parent b7b3449f48
commit e4b2fe4b78

View file

@ -96,6 +96,7 @@ class Patch(WestCommand):
help="Directory containing patch files",
metavar="DIR",
default=_WEST_MANIFEST_DIR / WEST_PATCH_BASE,
type=Path,
)
parser.add_argument(
"-l",
@ -103,6 +104,7 @@ class Patch(WestCommand):
help="Path to patches.yml file",
metavar="FILE",
default=_WEST_MANIFEST_DIR / WEST_PATCH_YAML,
type=Path,
)
parser.add_argument(
"-w",
@ -110,6 +112,7 @@ class Patch(WestCommand):
help="West workspace",
metavar="DIR",
default=_WEST_TOPDIR,
type=Path,
)
subparsers = parser.add_subparsers(