dockstore / dockstore

An app store for scientific workflows, tools, notebooks, and services
https://dockstore.org/
Apache License 2.0
119 stars 27 forks source link

Parameterless usage display #656

Closed denis-yuen closed 7 years ago

denis-yuen commented 7 years ago

Bug Report

Expected behaviour

Entering no parameters on all commands shows usage instructions ex:

$ dockstore

 ____             _        _                 
|  _ \  ___   ___| | _____| |_ ___  _ __ ___ 
| | | |/ _ \ / __| |/ / __| __/ _ \| '__/ _ \
| |_| | (_) | (__|   <\__ \ || (_) | | |  __/
|____/ \___/ \___|_|\_\___/\__\___/|_|  \___|

---------------------------------------------
See https://www.dockstore.org for more information

Usage: dockstore [mode] [flags] [command] [command parameters]

Modes:
   tool                Puts dockstore into tool mode.
   workflow            Puts dockstore into workflow mode.
   plugin              Configure and debug plugins.

---------------------------------------------

Flags:
  --help               Print help information
                       Default: false
  --debug              Print debugging information
                       Default: false
  --version            Print dockstore's version
                       Default: false
  --server-metadata    Print metadata describing the dockstore webservice
                       Default: false
  --upgrade            Upgrades to the latest stable release of Dockstore
                       Default: false
  --upgrade-stable     Force upgrade to the latest stable release of Dockstore
                       Default: false
  --upgrade-unstable   Force upgrade to the latest unstable release of Dockstore
                       Default: false
  --config <file>      Override config file
                       Default: ~/.dockstore/config
  --script             Will not check Github for newer versions of Dockstore, or ask for user input
                       Default: false
  --clean-cache        Delete the Dockstore launcher cache to save space

---------------------------------------------

$ dockstore workflow convert

 ____             _        _                 
|  _ \  ___   ___| | _____| |_ ___  _ __ ___ 
| | | |/ _ \ / __| |/ / __| __/ _ \| '__/ _ \
| |_| | (_) | (__|   <\__ \ || (_) | | |  __/
|____/ \___/ \___|_|\_\___/\__\___/|_|  \___|

---------------------------------------------
See https://www.dockstore.org for more information

Usage: dockstore workflow convert --help
       dockstore workflow convert cwl2json [parameters]
       dockstore workflow convert cwl2yaml [parameters]
       dockstore workflow convert wdl2json [parameters]
       dockstore workflow convert entry2json [parameters]
       dockstore workflow convert entry2tsv [parameters]

Description:
  They allow you to convert between file representations.

---------------------------------------------

Actual behaviour

However, some of the new command "leaves" do not

$ dockstore workflow convert entry2json
The following option is required: --entry 
com.beust.jcommander.ParameterException: The following option is required: --entry 
ubuntu@dockstore-staging-test:~$ dockstore workflow convert cwl2json

 ____             _        _                 
|  _ \  ___   ___| | _____| |_ ___  _ __ ___ 
| | | |/ _ \ / __| |/ / __| __/ _ \| '__/ _ \
| |_| | (_) | (__|   <\__ \ || (_) | | |  __/
|____/ \___/ \___|_|\_\___/\__\___/|_|  \___|

---------------------------------------------
See https://www.dockstore.org for more information

Usage: dockstore workflow convert --help
       dockstore workflow convert cwl2json [parameters]

Description:
  Spit out a json run file for a given cwl document.

Required parameters:
  --cwl <file>                Path to cwl file

---------------------------------------------

Write some tests to ensure that all command "leaves" display usage information. (Same with --help option for all)

Environment (Browser or OS and Dockstore version)

DockstoreUI - 1.2-alpha.3
DockstoreApi - 1.2.0-beta.0 
denis-yuen commented 7 years ago

Still an issue @garyluu can you point me toward your tests for this issue?

$ dockstore workflow convert entry2tsv
The following option is required: --entry 
com.beust.jcommander.ParameterException: The following option is required: --entry 
$ dockstore workflow convert entry2json
The following option is required: --entry 
com.beust.jcommander.ParameterException: The following option is required: --entry 
$ dockstore --version
Dockstore version 1.2.0-beta.1
garyluu commented 7 years ago

That's on the feature branch issue-656, I haven't made a pull request for it because issue-651 is kind of blocking

denis-yuen commented 7 years ago

@garyluu ok, thanks for the update

denis-yuen commented 7 years ago

Looks good now on staging