mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-26 02:18:42 +02:00
Adding --ansi to cli with support to the "never" value. Improves compatibility with SpringBoot3 compose plugin
This commit is contained in:
parent
a5c80a6cc7
commit
99222db163
@ -2286,7 +2286,16 @@ class PodmanCompose:
|
|||||||
) # pylint: disable=protected-access
|
) # pylint: disable=protected-access
|
||||||
for cmd_parser in cmd._parse_args: # pylint: disable=protected-access
|
for cmd_parser in cmd._parse_args: # pylint: disable=protected-access
|
||||||
cmd_parser(subparser)
|
cmd_parser(subparser)
|
||||||
|
|
||||||
self.global_args = parser.parse_args(argv)
|
self.global_args = parser.parse_args(argv)
|
||||||
|
|
||||||
|
if self.global_args.ansi:
|
||||||
|
if self.global_args.ansi == "never":
|
||||||
|
self.global_args.no_ansi = True
|
||||||
|
# if an option is added but we don't know how to handle it, fail!
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Unsupported --ansi value: {self.global_args.ansi}.")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
self.global_args.in_pod is not None
|
self.global_args.in_pod is not None
|
||||||
and self.global_args.in_pod.lower()
|
and self.global_args.in_pod.lower()
|
||||||
@ -2387,9 +2396,16 @@ class PodmanCompose:
|
|||||||
action="append",
|
action="append",
|
||||||
default=[],
|
default=[],
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--ansi",
|
||||||
|
help="Controls when to print ANSI control characters.",
|
||||||
|
choices=["never"],
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--no-ansi",
|
"--no-ansi",
|
||||||
help="Do not print ANSI control characters",
|
help="Do not print ANSI control characters. Equivalent to `--ansi=never`.",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
Loading…
Reference in New Issue
Block a user