diff --git a/README.md b/README.md index 948bfca4..d12481d9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ -@sumwatshade/oclif-plugin-update +# @sumwatshade/oclif-plugin-update + ==================== -> A fork of @oclif/plugin-update that modifies the functionality +> A fork of @oclif/plugin-update that closer mimics [NVM](https://github.com/nvm-sh/nvm) [![Version](https://img.shields.io/npm/v/@oclif/plugin-update.svg)](https://npmjs.org/package/@sumwatshade/oclif-plugin-update) [![CircleCI](https://circleci.com/gh/oclif/plugin-update/tree/master.svg?style=shield)](https://circleci.com/gh/sumwatshade/plugin-update/tree/master) @@ -12,10 +13,9 @@ * [Usage](#usage) * [Commands](#commands) -# Usage -See https://oclif.io/docs/releasing.html#autoupdater -# Commands +## Commands + * [`oclif-example install [VERSION]`](#oclif-example-install-version) * [`oclif-example update [CHANNEL]`](#oclif-example-update-channel) diff --git a/src/commands/install.ts b/src/commands/install.ts index c44cd352..2d651f56 100644 --- a/src/commands/install.ts +++ b/src/commands/install.ts @@ -7,7 +7,17 @@ import UpdateCommand from './update'; const SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?/; export default class InstallCommand extends UpdateCommand { - static args = [{ name: 'version', optional: false }]; + static description = + 'Install and link a new version of the <%= config.bin %> CLI. This will first check locally before fetching from the internet'; + + static args = [ + { + name: 'version', + description: + 'Specify an explicit version (ex. 3.0.0-next.1) or a channel (ex. alpha)', + optional: false, + }, + ]; static flags = {}; diff --git a/src/commands/update.ts b/src/commands/update.ts index 483fb1a3..bd21469f 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -12,9 +12,17 @@ import { extract } from '../tar'; import { ls, wait } from '../util'; export default class UpdateCommand extends Command { - static description = 'update the <%= config.bin %> CLI'; - - static args = [{ name: 'channel', optional: true }]; + static description = + 'update the <%= config.bin %> CLI. This will download a new binary'; + + static args = [ + { + name: 'channel', // name of arg to show in help and reference with args[name] + required: false, // make the arg required with `required: true` + description: + 'Specify a prerelease channel. An error will be thrown if this channel is invalid.', // help description + }, + ]; static flags: flags.Input = { autoupdate: flags.boolean({ hidden: true }), diff --git a/src/commands/use.ts b/src/commands/use.ts index b40343d1..1ffc261b 100644 --- a/src/commands/use.ts +++ b/src/commands/use.ts @@ -8,7 +8,17 @@ const SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?/; export default class UseCommand extends UpdateCommand { - static args = [{ name: 'version', optional: false }]; + static description = + 'Checks for a previously installed version of the <%= config.bin %> CLI. Throws an error if the version is not found.'; + + static args = [ + { + name: 'version', + description: + 'Specify an explicit version (ex. 3.0.0-next.1) or a channel (ex. alpha)', + optional: true, + }, + ]; static flags = {};