diff --git a/HISTORY.rst b/HISTORY.rst index 2839f032..d369f15c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,13 @@ Release History PlatformIO 2.0 -------------- +2.4.2 (2015-12-??) +~~~~~~~~~~~~~~~~~~ + +* Removed prompt with "auto-uploading" from `platformio init `__ + command and added ``--enable-auto-uploading`` option + (`issue #352 `_) + 2.4.1 (2015-12-01) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/userguide/cmd_init.rst b/docs/userguide/cmd_init.rst index 41c7b2ab..713ff39c 100644 --- a/docs/userguide/cmd_init.rst +++ b/docs/userguide/cmd_init.rst @@ -74,12 +74,11 @@ A list with supported IDE is available within ``platformio init --help`` command Also, please look into :ref:`ide` page. .. option:: - --disable-auto-uploading + --enable-auto-uploading If you initialise project with the specified :option:`platformio init --board`, then *PlatformIO* -will create environment with enabled firmware auto-uploading. This option -allows you to disable firmware auto-uploading by default. +will create environment with enabled firmware auto-uploading. .. option:: --env-prefix @@ -138,9 +137,6 @@ Examples $ platformio init --board uno - Would you like to enable firmware auto-uploading when project is successfully built using `platformio run` command? - Don't forget that you can upload firmware manually using `platformio run --target upload` command. [y/N]: y - The current working directory *** will be used for the new project. You can specify another project directory via `platformio init -d %PATH_TO_THE_PROJECT_DIR%` command. diff --git a/platformio/__init__.py b/platformio/__init__.py index 2b369209..5e23151c 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 4, 1) +VERSION = (2, 4, "2.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/init.py b/platformio/commands/init.py index f58654db..a9ceeb23 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -45,21 +45,11 @@ def validate_boards(ctx, param, value): # pylint: disable=W0613 callback=validate_boards) @click.option("--ide", type=click.Choice(ProjectGenerator.get_supported_ides())) -@click.option("--disable-auto-uploading", is_flag=True) +@click.option("--enable-auto-uploading", is_flag=True) @click.option("--env-prefix", default="") @click.pass_context def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 - disable_auto_uploading, env_prefix): - - # ask about auto-uploading - if board and app.get_setting("enable_prompts"): - disable_auto_uploading = not click.confirm( - "Would you like to enable firmware auto-uploading when project " - "is successfully built using `platformio run` command? \n" - "Don't forget that you can upload firmware manually using " - "`platformio run --target upload` command." - ) - click.echo("") + enable_auto_uploading, env_prefix): if project_dir == getcwd(): click.secho("\nThe current working directory", fg="yellow", nl=False) @@ -141,7 +131,7 @@ http://docs.platformio.org/en/latest/projectconf.html#lib-install if board: fill_project_envs( - ctx, project_file, board, disable_auto_uploading, env_prefix) + ctx, project_file, board, enable_auto_uploading, env_prefix) if ide: pg = ProjectGenerator(project_dir, ide, board[0] if board else None) @@ -154,12 +144,13 @@ http://docs.platformio.org/en/latest/projectconf.html#lib-install "`platformio run --target upload` or `platformio run -t upload` " "- upload firmware to embedded board\n" "`platformio run --target clean` - clean project (remove compiled " - "files)", + "files)\n" + "`platformio run --help` - additional information", fg="green" ) -def fill_project_envs(ctx, project_file, board_types, disable_auto_uploading, +def fill_project_envs(ctx, project_file, board_types, enable_auto_uploading, env_prefix): builtin_boards = get_boards() content = [] @@ -188,8 +179,8 @@ def fill_project_envs(ctx, project_file, board_types, disable_auto_uploading, content.append("framework = %s" % frameworks[0]) content.append("board = %s" % type_) - content.append("%stargets = upload" % ("# " if disable_auto_uploading - else "")) + if enable_auto_uploading: + content.append("targets = upload") _install_dependent_platforms(ctx, used_platforms)