Using Python's argparse module to create the CLI.
You can use the CLI by specifying the --help
argument in the terminal, but if possible, you can use it on the web.
As an image, I would like to match the contents of the help command with the web reference, such as awscli.
$aws3listhelp
LS() LS()
NAME
ls -
DESCRIPTION
List S3 objects and common prefixes under a prefix or all S3 buckets.
Note that the --output and --no-paginate arguments are ignored for this
command
See 'aws help' for descriptions of global parameters.
SYNOPSIS
ls
<S3Uri> or NONE
[--recursive]
[--page-size<value>]
[--human-readable]
[--summarize]
[--request-payer<value>]
OPTIONS
paths(string)
--recursive (boolean) Command is performed on all files or objects
under the specified directory or prefix.
https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html
Please let me know if there are any tools or patterns that are good for outputting CLI references as HTML.
The simple method is to "give help messages to argparse
and write help messages to HTML (actually sphinx), which would result in double management.
I looked at the awscli source to find out how it works, but I didn't really understand.
I understand that the contents of "Examples" seem to be loading files written in reStructuredText
The python script htmlgen
appears to be calling the ProviderHelpCommand
via awscli.clidriver
and generating it from it.
htmlgen
ProviderHelpCommand
© 2024 OneMinuteCode. All rights reserved.