weecology / retriever

Quickly download, clean up, and install public datasets into a database management system
http://data-retriever.org
Other
306 stars 134 forks source link

different usage prompt for retriever install #1090

Closed ss-is-master-chief closed 6 years ago

ss-is-master-chief commented 6 years ago

If we use retriever install, we are prompted with usage: retriever install [-h] [--compile] [--debug] [--not-cached] {mysql,postgres,sqlite,msaccess,csv,json,xml} ... and on using, for exampleretriever install csv, prompted with usage: retriever install csv [-h] [--table_name [TABLE_NAME]] dataset.

Could we change the usage alert into something common to both the incomplete command? How about usage: retriever install {mysql,postgres,sqlite,msaccess,csv,json,xml} [-h] [--compile] [--debug] [--not-cached] [--table_name [TABLE_NAME]] dataset?

[-path] could be a part of the usage alert as well.

henrykironde commented 6 years ago

@ss-is-master-chief, thanks for that idea, however this cannot be generic. It is a step wise process that only returns usage per level at which you are messing up. let me know if we are on the same page.

ss-is-master-chief commented 6 years ago

@henrykironde I agree. What about [-path]?

henrykironde commented 6 years ago

Good question. So in the CSV engine we don't have path as part of the required_opts

    required_opts = [
        ("table_name",
         "Format of table name",
         os.path.join(DATA_DIR, "{db}_{table}.csv")),
    ]
ss-is-master-chief commented 6 years ago

@henrykironde Got it. Thanks for the clarification. I'll close this.