diff --git a/platformio/maintenance.py b/platformio/maintenance.py index 350f4bf0..e225aa4f 100644 --- a/platformio/maintenance.py +++ b/platformio/maintenance.py @@ -28,7 +28,9 @@ def on_platformio_start(ctx, force): telemetry.on_command(ctx) # skip any check operations when upgrade process - if len(sys.argv) > 1 and sys.argv[1] == "upgrade": + args = [str(s).lower() for s in sys.argv[1:] + if not str(s).startswith("-")] + if len(args) > 1 and args[1] == "upgrade": return after_upgrade(ctx) diff --git a/platformio/telemetry.py b/platformio/telemetry.py index 3662b7f4..5017ace8 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -4,9 +4,9 @@ import atexit import platform import re +import sys import threading import uuid -from sys import argv as sys_argv from time import time import click @@ -91,7 +91,8 @@ class MeasurementProtocol(TelemetryBase): self['cd4'] = 1 if app.get_setting("enable_prompts") else 0 def _prefill_screen_name(self): - args = [str(s).lower() for s in sys_argv[1:]] + args = [str(s).lower() for s in sys.argv[1:] + if not str(s).startswith("-")] if not args: return