mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
take advantage of click's type validation/coercion
(saves us having to write the stuff ourselves). Also adds a small
click plugin to do datetime parsing.
Sample output:
```
[leohemsted:~/dev/api]$ flask command create_provider_rates --help
Usage: flask command create_provider_rates [OPTIONS]
Backfill rates for a given provider
Options:
-p, --provider_name [mmg|firetext|ses]
[required]
-c, --cost FLOAT Cost (pence) per message including decimals
[required]
-d, --valid_from DATE [required]
--help Show this message and exit.
[leohemsted:~/dev/api]$ flask command create_provider_rates -p ses -c 1.234 -d invalid
Usage: flask command create_provider_rates [OPTIONS]
Error: Invalid value for "-d" / "--valid_from": Could not parse datetime string "invalid" formatted as %Y-%m-%dT%H:%M:%S
```
This commit is contained in:
@@ -7,6 +7,7 @@ Flask-Marshmallow==0.8.0
|
||||
Flask-Migrate==2.1.1
|
||||
Flask-SQLAlchemy==2.3.2
|
||||
Flask==0.12.2
|
||||
click-datetime==0.2
|
||||
gunicorn==19.7.1
|
||||
iso8601==0.1.12
|
||||
jsonschema==2.6.0
|
||||
|
||||
Reference in New Issue
Block a user