1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2024-12-22 12:12:18 +01:00

Add option to print version with --version or -V

I guess `-v` is more commonly used for "verbose" so I will use the
short option of `-V` for version.
This commit is contained in:
Alan Orth 2019-08-02 00:09:08 +03:00
parent 456b8a2f26
commit 0561300ebe
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 3 additions and 0 deletions

View File

@ -1,3 +1,4 @@
from csv_metadata_quality.version import VERSION
import argparse
import csv_metadata_quality.check as check
import csv_metadata_quality.fix as fix
@ -11,6 +12,7 @@ def parse_args(argv):
parser.add_argument('--input-file', '-i', help='Path to input file. Can be UTF-8 CSV or Excel XLSX.', required=True, type=argparse.FileType('r', encoding='UTF-8'))
parser.add_argument('--output-file', '-o', help='Path to output file (always CSV).', required=True, type=argparse.FileType('w', encoding='UTF-8'))
parser.add_argument('--unsafe-fixes', '-u', help='Perform unsafe fixes.', action='store_true')
parser.add_argument('--version', '-V', action='version', version=f'CSV Metadata Quality v{VERSION}')
args = parser.parse_args()
return args

View File

@ -0,0 +1 @@
VERSION = '0.0.1'