mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-17 03:48:09 +00:00
4c8c96272c
Click REALLY INSISTS you provide on/off switches for your options. You can use is_flag, but then the presence of the option changes based on the default value. Which makes sense, really: @option("-f", "foobar", is_flag=True, default=False) you would expect `./cli -f` to have `foobar is True` whereas with @option("-f", "foobar", is_flag=True, default=True) you would expect `./cli -f` to have `foobar is False`, otherwise it's a no-op this becomes fun with `default=os.environ.get("SOMETHING")`, because then the effect of the option CHANGES with a value of environment variable! there's two ways around this: a) don't use defaults, update the flag explicitly, like: foobar = foobar or os.environ.get("FOOBAR") == "1" b) forget about is_flag and specify an on/off switch, where the default value works as intended since the latter is also technically speaking more correct, i'm doing it |
||
---|---|---|
.. | ||
assets | ||
embed | ||
mocks | ||
prof | ||
site_scons/site_tools/micropython | ||
src | ||
tests | ||
tools | ||
vendor | ||
.dockerignore | ||
.gitignore | ||
.pylintrc | ||
asan_blacklist.txt | ||
AUTHORS | ||
ChangeLog | ||
COPYING | ||
emu.py | ||
emu.sh | ||
Makefile | ||
README.md | ||
SConscript.boardloader | ||
SConscript.bootloader | ||
SConscript.firmware | ||
SConscript.prodtest | ||
SConscript.reflash | ||
SConscript.unix | ||
SConstruct | ||
trezor.sdcard.gz |
Trezor Core
Firmware currently running on Model T.
See docs/core
for more info.