v0.6.2
- Applied type casting & remove empty kwarg for Command (#108). A new method,
get_argument_type
, has been added to theCommand
class in thecli.py
file to determine the type of a given argument name based on the function's signature. The_route
method has been updated to remove any empty keyword arguments from thekwargs
dictionary, and apply type casting based on the argument type using theget_argument_type
method. This ensures that thekwargs
passed intoApp.command
are correctly typed and eliminates any empty keyword arguments, which were previously passed as empty strings. In the test file for the command-line interface, thefoo
command's keyword arguments have been updated to includeage
(int),salary
(float),is_customer
(bool), andaddress
(str) types, with thename
argument remaining and a default value foraddress
. Thetest_commands
andtest_injects_prompts
functions have been updated accordingly. These changes aim to improve the input validation and type safety of theApp.command
method.
Contributors: @nkvuong