Skip to content

Commit f9c7864

Browse files
authored
Merge pull request #237 from screamerbg/development
Improve documentation (0.8)
2 parents 0b0567c + 3b9700e commit f9c7864

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ This document covers the installation and usage of *mbed CLI*.
3434
2. [Change the test action](#change-the-test-action)
3535
3. [Limiting the test scope](#limiting-the-test-scope)
3636
4. [Test directory structure](#test-directory-structure)
37+
1. [mbed CLI configuration](#mbed-cli-configuration)
3738
1. [Known limitations](#known-limitations)
3839

3940
## Installation
@@ -62,6 +63,8 @@ You can get the latest stable version of *mbed CLI* via PyPI by running:
6263
$ pip install mbed-cli
6364
```
6465

66+
On Linux/Mac, you may need to run with `sudo`.
67+
6568
Alternatively you get the development version of *mbed CLI* by cloning the development repository [https://github.com/ARMmbed/mbed-cli](https://github.com/ARMmbed/mbed-cli):
6669

6770
`$ git clone https://github.com/ARMmbed/mbed-cli`
@@ -686,6 +689,31 @@ As shown above, tests exist inside ```TESTS\testgroup\testcase\``` directories.
686689

687690
<span class="notes">**Note:** This feature does not work in applications that contain a ```main``` function that is outside of a `TESTS` directory.</span>
688691

692+
## mbed CLI configuration
693+
694+
Many options in *mbed CLI* can be streamlined with global and local configuration.
695+
696+
The *mbed CLI* configuration syntax is:
697+
```
698+
mbed config [--global] <var> [value] [--unset]
699+
```
700+
701+
The **global** configuration (via `--global` option) defines the default behavior of *mbed CLI* across programs unless overridden by *local* settings.
702+
703+
The **local** configuration (without `--global`) is per mbed program and allows overriding of global or default *mbed CLI* settings within the scope of a program or library and its dependencies.
704+
705+
If **no value** is specified then *mbed CLI* will print the currently set value for this settings from either local or global scope.
706+
707+
The `--unset` option allows removing of a setting.
708+
709+
Here is a list of currently implemented configuration settings:
710+
* `target` - Define default target for `compile`, `test` and `export`, and is an alias to `mbed target`. Default: none.
711+
* `toolchain` - Defines default toolchain for `compile` and `test` can be set through `mbed toolchain`. Default: none.
712+
* `ARM_PATH`, `GCC_ARM_PATH`, `IAR_PATH` - defines default path to ARM Compiler, GCC ARM and IAR Workbench toolchains. Default: none.
713+
* `protocol` - Defines the default protocol used for importing/cloning of programs and libraries. Possible values are `https`, `http` and `ssh`. Use `ssh` if you have generated and registered SSH keys (Public Key Authentication) with a service like GitHub, GitLab, Bitbucket, etc. Read more about SSH keys [here](https://help.github.com/articles/generating-an-ssh-key/) Default: `https`.
714+
* `depth` - Defines *clone* depth for importing/cloning and applies only to *Git* repositories. Note that while this option may improve cloning speed, it may also prevent you from correctly checking out a dependency tree when the reference revision hash is older than the clone depth. Read more about shallow clones [here](https://git-scm.com/docs/git-clone). Default: none.
715+
* `cache` (EXPERIMENTAL) - Defines local path that will be used to store minimalistic copies of the imported/cloned repositories and attempt to use them to minimize traffic and speed up future importing. This feature is still under development, so this should not be used within a production environment. Default: none (disabled).
716+
689717
## Known limitations
690718

691719
<span class="warnings">**Warning**: At this point, *mbed CLI* is alpha quality and very much in development. Breakages are fully expected. Please open issues on this repository for any problems that you find with *mbed CLI*.</span>

mbed/mbed.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ def action(msg):
132132

133133
def warning(msg):
134134
for line in msg.splitlines():
135-
sys.stderr.write("[mbed WARNING] %s\n" % line)
135+
sys.stderr.write("[mbed] WARNING: %s\n" % line)
136136
sys.stderr.write("---\n")
137137

138138
def error(msg, code=-1):
139139
for line in msg.splitlines():
140-
sys.stderr.write("[mbed ERROR] %s\n" % line)
140+
sys.stderr.write("[mbed] ERROR: %s\n" % line)
141141
sys.stderr.write("---\n")
142142
sys.exit(code)
143143

@@ -2225,7 +2225,8 @@ def help_():
22252225
else:
22262226
error('OS Error: %s' % e[1], e[0])
22272227
except KeyboardInterrupt as e:
2228-
error('User aborted!', 255)
2228+
log('User aborted!', -1)
2229+
sys.exit(255)
22292230
except Exception as e:
22302231
if very_verbose:
22312232
traceback.print_exc(file=sys.stdout)

0 commit comments

Comments
 (0)