Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 711 Bytes

File metadata and controls

14 lines (10 loc) · 711 Bytes

https://www.youtube.com/playlist?list=PLhOuww6rJJNNx06soCkb4aMFhuioQ7tY5

Examples of programs using docopt

This is a collection of example programs to show how you can use the standard Python module docopt to handle command-line aruguments.

  • one_arg.py: one positional argument
  • nargs2.py: another way to handle two positional arguments
  • nargs+.py: one or more positional arguments
  • cat_n.py: a Python implementation of cat -n
  • manual.py: manually validating an argument value inside get_args (using type-docopt)
  • two_args.py: two positional arguments (automatic validating using Pydantic)
  • choices.py: using choices to restrict values (automatic validating using Pydantic)