Skip to content

customisation to swift argumentparser's help command output and error output #807

@prsinghgit

Description

@prsinghgit

Hello I want to implement customisation to swift argumentparser, Here are following changes want to do it in my cli

  1. changing default footer present in help command output

currently help command output coming like this

OVERVIEW: clisample
USAGE: clisample <subcommand>
 
OPTIONS:
  --version               show the version.
  -h, --help              show the help.
 
SUBCOMMANDS:
  logs (default)          Export logs for clisample processes.
 
See 'clisample --help' for more information.'`

so instead of See 'clisample --help' for more information.' I want For more details, run 'clisample help <subcommand>'

  1. customise error string getting from validation error

currently output of error

Error: Missing value for '-t <time>
Help:  -t <time>  Time window (e.g. 10h, 30m, 2d).
Usage: clisample logs --time <time>
 
  See 'clisample logs --help' for more information.

so I want error output with example and customised footer, like this

Error: Missing value for '-t <time>'
	Help:  -t <time>  Time window (e.g. 10h, 30m, 2d).
	Usage: clisample logs --time <time> 
	Example: clisample logs -t 5m
	 
	  For more details, run 'clisample help <subcommand>'

If this feature is already available, please guide me, as i haven't seen anything on forums and any other place

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