mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Improve handling of sys.args
This commit is contained in:
@ -28,7 +28,9 @@ def on_platformio_start(ctx, force):
|
|||||||
telemetry.on_command(ctx)
|
telemetry.on_command(ctx)
|
||||||
|
|
||||||
# skip any check operations when upgrade process
|
# 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
|
return
|
||||||
|
|
||||||
after_upgrade(ctx)
|
after_upgrade(ctx)
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
import atexit
|
import atexit
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import uuid
|
import uuid
|
||||||
from sys import argv as sys_argv
|
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
import click
|
import click
|
||||||
@ -91,7 +91,8 @@ class MeasurementProtocol(TelemetryBase):
|
|||||||
self['cd4'] = 1 if app.get_setting("enable_prompts") else 0
|
self['cd4'] = 1 if app.get_setting("enable_prompts") else 0
|
||||||
|
|
||||||
def _prefill_screen_name(self):
|
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:
|
if not args:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user