Move "in_silence" to PlatformioCLI

This commit is contained in:
Ivan Kravets committed 2019-05-21 13:18:11 +03:00
1 parent a30b79c5fc
commit 4386dc56ea
5 files changed
+14 -14

No files matched your search

+8
View File
@@ -22,6 +22,14 @@ class PlatformioCLI(click.MultiCommand):
leftover_args = []
@staticmethod
def in_silence():
args = PlatformioCLI.leftover_args
return args and any([
args[0] == "debug" and "--interpreter" in " ".join(args),
args[0] == "upgrade", "--json-output" in args, "--version" in args
])
def invoke(self, ctx):
PlatformioCLI.leftover_args = ctx.args
if hasattr(ctx, "protected_args"):
+1 -1
View File
@@ -80,7 +80,7 @@ def cli(ctx, **options):
ctx.invoked_subcommand)
ctx.obj = LibraryManager(storage_dir)
if "--json-output" not in PlatformioCLI.leftover_args:
if not PlatformioCLI.in_silence():
click.echo("Library Storage: " + storage_dir)