Fixed an issue when "debug", "home", "run", and "test" commands were not shown in "platformio --help" CLI

This commit is contained in:
Ivan Kravets
2019-07-18 00:19:30 +03:00
parent b17e318373
commit 6ea49910d5
2 changed files with 9 additions and 5 deletions

View File

@ -14,6 +14,7 @@ PlatformIO 4.0
* Improved computing of project check sum (structure, configuration) and avoid unnecessary rebuilding * Improved computing of project check sum (structure, configuration) and avoid unnecessary rebuilding
* Renamed "enable_ssl" setting to `strict_ssl <http://docs.platformio.org/page/userguide/cmd_settings.html#strict-ssl>`__ * Renamed "enable_ssl" setting to `strict_ssl <http://docs.platformio.org/page/userguide/cmd_settings.html#strict-ssl>`__
* Fixed an issue with incorrect escaping of Windows slashes when using `PIO Unified Debugger <http://docs.platformio.org/page/plus/debugging.html>`__ and "piped" openOCD * Fixed an issue with incorrect escaping of Windows slashes when using `PIO Unified Debugger <http://docs.platformio.org/page/plus/debugging.html>`__ and "piped" openOCD
* Fixed an issue when "debug", "home", "run", and "test" commands were not shown in "platformio --help" CLI
4.0.0 (2019-07-10) 4.0.0 (2019-07-10)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

View File

@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import os import os
from os.path import dirname from os.path import dirname, isfile, join
import click import click
@ -38,11 +38,14 @@ class PlatformioCLI(click.MultiCommand):
def list_commands(self, ctx): def list_commands(self, ctx):
cmds = [] cmds = []
for filename in os.listdir(dirname(__file__)): cmds_dir = dirname(__file__)
if filename.startswith("__init__"): for name in os.listdir(cmds_dir):
if name.startswith("__init__"):
continue continue
if filename.endswith(".py"): if isfile(join(cmds_dir, name, "command.py")):
cmds.append(filename[:-3]) cmds.append(name)
elif name.endswith(".py"):
cmds.append(name[:-3])
cmds.sort() cmds.sort()
return cmds return cmds