Skip to content
This repository has been archived by the owner on Apr 10, 2021. It is now read-only.

make basic cli #7

Closed
ctaggart opened this issue Sep 20, 2020 · 1 comment
Closed

make basic cli #7

ctaggart opened this issue Sep 20, 2020 · 1 comment

Comments

@ctaggart
Copy link
Owner

Need to make a basic cli before shipping this. Probably using clap builder pattern. Looking at autorest --help, the minimum for now would be:

  --input-file=<string | string[]>  OpenAPI file to use as input (use this setting repeatedly to pass multiple files at once)
  --output-folder=<string>      target folder for generated artifacts; default: "<base folder>/generated"

May be a reqwest option to indicate that it is the first implementation. May be only add in when there is a second option.

  --reqwest                  generate reqwest client code

Here is the autorest help for reference.

$ autorest --help

WARNING: AutoRest has not been tested with Node versions greater than v13.

AutoRest code generation utility [cli version: 3.0.6187; node: v14.7.0, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
   Loading AutoRest core      '/usr/local/lib/node_modules/@autorest/core/dist' (3.0.6302)


Usage: autorest [configuration-file.md] [...options]

  See: https://aka.ms/autorest/cli for additional documentation

Overall Verbosity

  --verbose                     display verbose logging information
  --debug                       display debug logging information

Manage Installation

  --info                        display information about the installed version of autorest and its extensions
  --list-available              display available AutoRest versions
  --reset                       removes all autorest extensions and downloads the latest version of the autorest-core extension
  --preview                     enables using autorest extensions that are not yet released
  --latest                      installs the latest autorest-core extension
  --force                       force the re-installation of the autorest-core extension and frameworks
  --version=<string>            use the specified version of the autorest-core extension

Core Settings and Switches

  --help                        display help (combine with flags like --csharp to get further details about specific functionality)
  --input-file=<string | string[]>  OpenAPI file to use as input (use this setting repeatedly to pass multiple files at once)
  --output-folder=<string>      target folder for generated artifacts; default: "<base folder>/generated"
  --clear-output-folder         clear the output folder before writing generated artifacts to disk (use with extreme caution!)
  --base-folder=<string>        path to resolve relative paths (input/output files/folders) against; default: directory of configuration file, current directory otherwise
  --message-format=<"regular" | "json">  format of messages (e.g. from OpenAPI validation); default: "regular"
  --github-auth-token=<string>  OAuth token to use when pointing AutoRest at files living in a private GitHub repository

Core Functionality
   While AutoRest can be extended arbitrarily by 3rd parties (say, with a custom generator),
   we officially support and maintain the following functionality.
   More specific help is shown when combining the following switches with --help .

  --csharp                      generate C# client code
  --go                          generate Go client code
  --java                        generate Java client code
  --python                      generate Python client code
  --nodejs                      generate NodeJS client code
  --typescript                  generate TypeScript client code
  --ruby                        generate Ruby client code
  --php                         generate PHP client code
  --azureresourceschema         generate Azure resource schemas
  --model-validator             validates an OpenAPI document against linked examples (see https://github.com/Azure/azure-rest-api-specs/search?q=x-ms-examples )
  --azure-validator             validates an OpenAPI document against guidelines to improve quality (and optionally Azure guidelines)
[0.79 s] Generation Complete
ctaggart added a commit that referenced this issue Sep 21, 2020
uses clap, fix #7
@ctaggart
Copy link
Owner Author

this is done in pr #6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant