Add comments suggesting to keep shell completion scripts up-to-date near cmd line argument code
This commit is contained in:
parent
99fadccd29
commit
ce691f8c98
|
@ -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')),
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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='.')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 '
|
||||
|
|
|
@ -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.')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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.')
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue