From 7873814e1433b64eef674a993359a58cee52f131 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 17 May 2019 10:00:20 -0300 Subject: Move examples into help option --- README.md | 5 ++--- ckandumper | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4639f51..c549556 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ Works on python 3.7 with the following dependencies met: apt install wget python3-tqdm -## Examples +## Usage - ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://opendata.swiss/en/ switzerland/ - ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://open.canada.ca/data/en/ canada/ + ckandumper --help diff --git a/ckandumper b/ckandumper index a371220..400fc61 100755 --- a/ckandumper +++ b/ckandumper @@ -321,7 +321,12 @@ class CkanDumper: if __name__ == "__main__": # Parse CLI - parser = argparse.ArgumentParser(description='Dump CKAN metadata and datasets.') + examples = """ Examples: + + ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://open.canada.ca/data/en/ canada/ + ckandumper --limit-concurrent=10 --limit-rate=100k --randomize https://opendata.swiss/en/ switzerland/ + """ + parser = argparse.ArgumentParser(description='Dump CKAN metadata and datasets.', epilog=examples, formatter_class=argparse.RawDescriptionHelpFormatter,) parser.add_argument('url', nargs='+', help='CKAN instance URL') parser.add_argument('dest', nargs='+', help='Destination folder') parser.add_argument('--limit-rate', help='Limit the download speed to amount bytes per second, per download') -- cgit v1.2.3