Skip to content

-l language parameter is invalid #66

@kimsin98

Description

@kimsin98
$ datalad hello-cmd -l en
usage: datalad [-c (:name|name=value)] [-C PATH] [--cmd] [-l LEVEL] [--on-failure {ignore,continue,stop}]
               [--report-status {success,failure,ok,notneeded,impossible,error}] [--report-type {dataset,file}]
               [-f {generic,json,json_pp,tailored,disabled,'<template>'}] [--dbg] [--idbg] [--version]
               {create-sibling-github,create-sibling-gitlab,create-sibling-gogs,create-sibling-gin,create-sibling-gitea,create-sibling-ria,create-sibling,siblings,update,subdatasets,drop,remove,addurls,copy-file,download-url,foreach-dataset,install,rerun,run-procedure,create,save,status,clone,get,push,run,diff,configuration,wtf,clean,add-archive-content,add-readme,export-archive,export-archive-ora,export-to-figshare,no-annex,check-dates,unlock,uninstall,create-test-dataset,sshrun,shell-completion}
               ...
datalad: error: argument {create-sibling-github,create-sibling-gitlab,create-sibling-gogs,create-sibling-gin,create-sibling-gitea,create-sibling-ria,create-sibling,siblings,update,subdatasets,drop,remove,addurls,copy-file,download-url,foreach-dataset,install,rerun,run-procedure,create,save,status,clone,get,push,run,diff,configuration,wtf,clean,add-archive-content,add-readme,export-archive,export-archive-ora,export-to-figshare,no-annex,check-dates,unlock,uninstall,create-test-dataset,sshrun,shell-completion}: invalid choice: 'hello-cmd' (choose from 'create-sibling-github', 'create-sibling-gitlab', 'create-sibling-gogs', 'create-sibling-gin', 'create-sibling-gitea', 'create-sibling-ria', 'create-sibling', 'siblings', 'update', 'subdatasets', 'drop', 'remove', 'addurls', 'copy-file', 'download-url', 'foreach-dataset', 'install', 'rerun', 'run-procedure', 'create', 'save', 'status', 'clone', 'get', 'push', 'run', 'diff', 'configuration', 'wtf', 'clean', 'add-archive-content', 'add-readme', 'export-archive', 'export-archive-ora', 'export-to-figshare', 'no-annex', 'check-dates', 'unlock', 'uninstall', 'create-test-dataset', 'sshrun', 'shell-completion')

It happens because the parameter conflicts with -l LEVEL. This error doesn't appear when the short parameter is -L.

It would be also nice if the error message was less intimidating. Not sure why error for invalid -l is particularly so long.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions