diff --git a/src/commands/openapi/convert.ts b/src/commands/openapi/convert.ts index a84127923..51ca5d922 100644 --- a/src/commands/openapi/convert.ts +++ b/src/commands/openapi/convert.ts @@ -3,12 +3,12 @@ import type { OASDocument } from 'oas/types'; import fs from 'node:fs'; import path from 'node:path'; -import { Args, Flags } from '@oclif/core'; +import { Flags } from '@oclif/core'; import chalk from 'chalk'; import prompts from 'prompts'; import BaseCommand from '../../lib/baseCommand.js'; -import { titleFlag, workingDirectoryFlag } from '../../lib/flags.js'; +import { specArg, titleFlag, workingDirectoryFlag } from '../../lib/flags.js'; import { warn } from '../../lib/logger.js'; import prepareOas from '../../lib/prepareOas.js'; import promptTerminal from '../../lib/promptWrapper.js'; @@ -21,7 +21,7 @@ export default class OpenAPIConvertCommand extends BaseCommand { + static description = 'Upload (or reupload) your API definition to ReadMe.'; + static args = { - spec: Args.string({ - summary: 'A file/URL to your API definition', - description: - 'If your working directory and all subdirectories contain a single OpenAPI file, you can omit the file name.', - }), + spec: specArg, }; - static description = 'the new openapi command yayay'; - static flags = { key: keyFlag, uri: Flags.string({ @@ -48,11 +44,6 @@ export default class OpenAPIUploadCommand extends BaseCommand <%= command.id %> --version=1.0.0 openapi.json', }, - { - description: - 'If your working directory and all subdirectories contain a single OpenAPI file, you can omit the file name:', - command: '<%= config.bin %> <%= command.id %> --version=1.0.0', - }, { description: 'You can also pass in a file in a subdirectory (we recommend always running the CLI from the root of your repository):', diff --git a/src/commands/openapi/validate.ts b/src/commands/openapi/validate.ts index 957ac91b2..3c067dbc1 100644 --- a/src/commands/openapi/validate.ts +++ b/src/commands/openapi/validate.ts @@ -1,8 +1,7 @@ -import { Args } from '@oclif/core'; import chalk from 'chalk'; import BaseCommand from '../../lib/baseCommand.js'; -import { githubFlag, workingDirectoryFlag } from '../../lib/flags.js'; +import { githubFlag, specArg, workingDirectoryFlag } from '../../lib/flags.js'; import prepareOas from '../../lib/prepareOas.js'; export default class OpenAPIValidateCommand extends BaseCommand { @@ -15,7 +14,7 @@ export default class OpenAPIValidateCommand extends BaseCommand