Skip to content

Commit 01ae20d

Browse files
feat(fw): add full function list to help()
1 parent c147be7 commit 01ae20d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

firmware/main.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,17 +363,31 @@ def demo_driving_stepper_motor() -> None:
363363
time.sleep(2)
364364

365365

366+
def get_all_functions() -> list[str]:
367+
function_type = type(lambda: None)
368+
369+
return list(
370+
sorted(
371+
n
372+
for n, o in globals().items()
373+
if isinstance(o, function_type) and not n.startswith("_")
374+
)
375+
)
376+
377+
366378
def print_available_commands() -> None:
367379
print("""
368380
Available commands:
369381
- help()
370-
- init(), reset()
371-
372382
373383
- <just a single period>
374384
-> Repeat the last command.
375385
""")
376386

387+
print("All functions:")
388+
for func in get_all_functions():
389+
print(f" - {func}(...)")
390+
377391

378392
def help() -> None:
379393
print_available_commands()

0 commit comments

Comments
 (0)