Skip to content

Commit

Permalink
Add CLI script to setup.py, so 'duckargs' can be called directly
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknyquist committed Oct 12, 2023
1 parent 9d600c2 commit 25b9338
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ Install with pip (python 3x required):
Example
=======

Run duckargs from the command line via ``python -m duckargs``, followed by whatever arguments/options/flags
you want your program to accept, and ``duckargs`` will print the corresponding python code.
Run duckargs from the command line via ``duckargs`` or ``python -m duckargs``, followed
by whatever arguments/options/flags you want your program to accept, and ``duckargs``
will print the corresponding python code. For example:

::

$ python -m duckargs positional_arg1 positional_arg2 -i --int-val 4 -f 3.3 -f --file FILE -F --otherfile FILE -a -b -c
$ duckargs positional_arg1 positional_arg2 -i --int-val 4 -f 3.3 -f --file FILE -F --otherfile FILE -a -b -c


The output of the above command looks like this:
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def run(self):
cmdclass={'test': RunDuckargsTests},
include_package_data=True,
zip_safe=False,
entry_points = {
'console_scripts': ['duckargs=duckargs.__main__:main']
},
python_requires=">=3.7",
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down

0 comments on commit 25b9338

Please sign in to comment.