iotile / iotile/typedargs

Not passing enough arguments should result in better error

Open
#46 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

When calling a method from the command line without filling in all arguments, you get a traceback and a `TypeError` rather than a nice message saying you are missing an argument:

```
(GPIOPipelineProxy) run_count
Traceback (most recent call last):
File "c:\arch\coretools\iotilecore\iotile\core\scripts\iotile_script.py", line 246, in main
finished = shell.invoke_string(linebuf)
File "c:\arch\typedargs\typedargs\shell.py", line 522, in invoke_string
return self.invoke(args)
File "c:\arch\typedargs\typedargs\shell.py", line 493, in invoke
val, line, finished = self.invoke_one(line)
File "c:\arch\typedargs\typedargs\shell.py", line 456, in invoke_one
val = func(*posargs, **kwargs)
TypeError: run_count() takes exactly 2 arguments (1 given)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.