Skip to content

Commit

Permalink
Fixing some docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaak-Malers committed Feb 23, 2024
1 parent b81b1c9 commit f51c5ba
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CliFunction.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import inspect
import sys
import re


"""
Provides the simplest possible wrapper for exposing python functions to be run on a command line!
Annotate python functions with the [@cli_function] decorator, and annotate the function fully with the builtin python tools.
The library will generate a man page for your file, and provide helpful error messages when arguments are not formatted correctly.
"""

Expand Down Expand Up @@ -51,7 +47,10 @@ def name_and_abbreviations(self, *, python_name: str) -> [str]:
return sorted(list({python_name, abbreviation.lower()}), key=lambda item: -len(item))

def type_coercer(self, *, arg: str, desired_type: type):

"""
given a string representation of an argument from the CLI, and a 'desired type' annotation, it will return the type desired or None
Note that there are only a limited number of types supported.
"""
if desired_type is str:
return arg

Expand Down

0 comments on commit f51c5ba

Please sign in to comment.