Skip to content

Commit

Permalink
Fix command option typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Dec 12, 2024
1 parent 9a95e35 commit 00a83af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesonbuild/mconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class CMDOptions(coredata.SharedCMDOptions, Protocol):
builddir: str
clearcache: bool
pager: bool
unset_opts: T.List[str]

# cannot be TV_Loggable, because non-ansidecorators do direct string concat
LOGLINE = T.Union[str, mlog.AnsiDecorator]
Expand Down Expand Up @@ -352,14 +353,14 @@ def print_augments(self) -> None:
else:
mlog.log('\nThere are no option augments.')

def has_option_flags(options: T.Any) -> bool:
def has_option_flags(options: CMDOptions) -> bool:
if options.cmd_line_options:
return True
if options.unset_opts:
return True
return False

def is_print_only(options: T.Any) -> bool:
def is_print_only(options: CMDOptions) -> bool:
if has_option_flags(options):
return False
if options.clearcache:
Expand Down
1 change: 1 addition & 0 deletions mesonbuild/msetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CMDOptions(SharedCMDOptions, Protocol):
builddir: str
sourcedir: str
pager: bool
unset_opts: T.List[str]

git_ignore_file = '''# This file is autogenerated by Meson. If you change or delete it, it won't be recreated.
*
Expand Down

0 comments on commit 00a83af

Please sign in to comment.