MCPcopy
hub / github.com/google/python-fire / _IsFlag

Function _IsFlag

fire/core.py:936–946  ·  view source on GitHub ↗

Determines if the argument is a flag argument. If it starts with a hyphen and isn't a negative number, it's a flag. Args: argument: A command line argument that may or may not be a flag. Returns: A boolean indicating whether the argument is a flag.

(argument)

Source from the content-addressed store, hash-verified

934
935
936def _IsFlag(argument):
937 """Determines if the argument is a flag argument.
938
939 If it starts with a hyphen and isn't a negative number, it's a flag.
940
941 Args:
942 argument: A command line argument that may or may not be a flag.
943 Returns:
944 A boolean indicating whether the argument is a flag.
945 """
946 return _IsSingleCharFlag(argument) or _IsMultiCharFlag(argument)
947
948
949def _IsSingleCharFlag(argument):

Callers 1

_ParseKeywordArgsFunction · 0.85

Calls 2

_IsSingleCharFlagFunction · 0.85
_IsMultiCharFlagFunction · 0.85

Tested by

no test coverage detected