Add comments suggesting to keep shell completion scripts up-to-date near cmd line argument code

This commit is contained in:
Luke Elliott 2023-09-11 07:37:51 +01:00 committed by Jussi Pakkanen
parent 99fadccd29
commit ce691f8c98
15 changed files with 29 additions and 0 deletions

View File

@ -1332,6 +1332,7 @@ class BuiltinOption(T.Generic[_T, _U]):
# Update `docs/markdown/Builtin-options.md` after changing the options below
# Also update mesonlib._BUILTIN_NAMES. See the comment there for why this is required.
# Please also update completion scripts in $MESONSRC/data/shell-completions/
BUILTIN_DIR_OPTIONS: 'MutableKeyedOptionDictType' = OrderedDict([
(OptionKey('prefix'), BuiltinOption(UserStringOption, 'Installation prefix', default_prefix())),
(OptionKey('bindir'), BuiltinOption(UserStringOption, 'Executable directory', 'bin')),

View File

@ -301,6 +301,8 @@ def get_parsed_args_xcode(options: 'argparse.Namespace', builddir: Path) -> T.Tu
cmd += options.xcode_args
return cmd, None
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: 'argparse.ArgumentParser') -> None:
"""Add compile specific arguments."""
parser.add_argument(

View File

@ -35,6 +35,8 @@ if T.TYPE_CHECKING:
# cannot be TV_Loggable, because non-ansidecorators do direct string concat
LOGLINE = T.Union[str, mlog.AnsiDecorator]
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: 'argparse.ArgumentParser') -> None:
coredata.register_builtin_arguments(parser)
parser.add_argument('builddir', nargs='?', default='.')

View File

@ -18,6 +18,8 @@ if T.TYPE_CHECKING:
POWERSHELL_EXES = {'pwsh.exe', 'powershell.exe'}
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
parser.add_argument('-C', dest='builddir', type=Path, default='.',
help='Path to build directory')

View File

@ -48,6 +48,8 @@ archive_extension = {'gztar': '.tar.gz',
'xztar': '.tar.xz',
'zip': '.zip'}
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
parser.add_argument('-C', dest='wd', action=RealPathAction,
help='directory to cd into before running')

View File

@ -153,6 +153,8 @@ def autodetect_options(options: Arguments, sample: bool = False) -> None:
raise SystemExit("Can't autodetect language, please specify it with -l.")
print("Detected language: " + options.language)
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: 'argparse.ArgumentParser') -> None:
'''
Here we add args for that the user can passed when making a new

View File

@ -72,6 +72,8 @@ false to copy the link.'''
selinux_updates: T.List[str] = []
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
parser.add_argument('-C', dest='wd', action=RealPathAction,
help='directory to cd into before running')

View File

@ -90,6 +90,8 @@ def get_meson_introspection_types(coredata: T.Optional[cdata.CoreData] = None,
('tests', IntroCommand('List all unit tests', func=lambda: list_tests(testdata))),
])
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
intro_types = get_meson_introspection_types()
for key, val in intro_types.items():

View File

@ -31,6 +31,8 @@ syntax: glob
'''
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
coredata.register_builtin_arguments(parser)
parser.add_argument('--native-file',

View File

@ -657,6 +657,8 @@ def add_wrap_update_parser(subparsers: 'SubParsers') -> argparse.ArgumentParser:
p.set_defaults(pre_func=Runner.pre_update_wrapdb)
return p
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
subparsers = parser.add_subparsers(title='Commands', dest='command')
subparsers.required = True

View File

@ -124,6 +124,8 @@ def determine_worker_count() -> int:
num_workers = 1
return num_workers
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
parser.add_argument('--maxfail', default=0, type=int,
help='Number of failing tests before aborting the '

View File

@ -21,6 +21,8 @@ import os.path
import pprint
import textwrap
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser):
parser.add_argument('--all', action='store_true', dest='all', default=False,
help='Show data not used by current backend.')

View File

@ -38,6 +38,8 @@ if T.TYPE_CHECKING:
class RewriterException(MesonException):
pass
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser, formatter=None):
parser.add_argument('-s', '--sourcedir', type=str, default='.', metavar='SRCDIR', help='Path to source directory.')
parser.add_argument('-V', '--verbose', action='store_true', default=False, help='Enable verbose output')

View File

@ -31,6 +31,8 @@ def has_for_build() -> bool:
return True
return False
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: 'argparse.ArgumentParser') -> None:
parser.add_argument('--debarch', default=None,
help='The dpkg architecture to generate.')

View File

@ -28,6 +28,8 @@ from .. import mesonlib, msubprojects
if T.TYPE_CHECKING:
import argparse
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: 'argparse.ArgumentParser') -> None:
subparsers = parser.add_subparsers(title='Commands', dest='command')
subparsers.required = True