Skip to content

Conversation

@DannyBen
Copy link
Member

@DannyBen DannyBen commented Dec 19, 2019

Add the ability to create a usage text like this:

ftp - Sample application with command grouping

Usage:
  ftp [command] [options]
  ftp [command] --help | -h
  ftp --version

File Commands:
  download   Download a file
  upload     Upload a file

Login Commands:
  login      Write login credentials to the config file
  logout     Delete login credentials to the config file

By adding group caption in the first command in each group, like this:

name: ftp
help: Sample application with command grouping
version: 0.1.0

commands:
- name: download
  help: Download a file
  group: File

  args:
  - name: file
    required: true
    help: File to download

- name: upload
  help: Upload a file

  args:
  - name: file
    required: true
    help: File to upload

- name: login
  help: Write login credentials to the config file
  group: Login

- name: logout
  help: Delete login credentials to the config file

In addition, rename subcommands to commands in many places, ,to be consistent. We now use subcommands to state that this is a nested command.

@DannyBen DannyBen merged commit 04a7bfa into master Dec 19, 2019
@DannyBen DannyBen deleted the updates branch December 19, 2019 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants