From 25c448627e9b54420c795cde69e6b62fee0f76ee Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 2 Sep 2015 23:07:45 +0300 Subject: [PATCH] Added short "-h" help option for PlatformIO and sub-commands --- HISTORY.rst | 1 + docs/userguide/index.rst | 4 ++-- platformio/__main__.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 87fffb30..144db030 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -24,6 +24,7 @@ PlatformIO 2.0 `atmelavr `__ platform (`pull #256 `_) +* Added short ``-h`` help option for PlatformIO and sub-commands * Updated ``tool-teensy`` for `Teensy `__ platform (`issue #268 `_) diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst index 6c52a9e5..5f72d899 100644 --- a/docs/userguide/index.rst +++ b/docs/userguide/index.rst @@ -18,7 +18,7 @@ Options .. program:: platformio .. option:: - --force, - f + --force, -f Force to accept any confirmation prompts. This option allows to avoid an issue with :ref:`faq_troubleshooting_pioblocksprompt` @@ -29,7 +29,7 @@ with :ref:`faq_troubleshooting_pioblocksprompt` Show the version of PlatformIO .. option:: - --help + --help, -h Show help for the available options and commands diff --git a/platformio/__main__.py b/platformio/__main__.py index fc1af876..f2ed3308 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -51,7 +51,8 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904 raise AttributeError() -@click.command(cls=PlatformioCLI) +@click.command(cls=PlatformioCLI, + context_settings=dict(help_option_names=["-h", "--help"])) @click.version_option(__version__, prog_name="PlatformIO") @click.option("--force", "-f", is_flag=True, help="Force to accept any confirmation prompts")