Skip to content

Commit

Permalink
fix: add docs for each command
Browse files Browse the repository at this point in the history
  • Loading branch information
sumwatshade committed Jun 23, 2021
1 parent 119e059 commit 1066934
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -12,10 +13,9 @@
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->
# Usage
See https://oclif.io/docs/releasing.html#autoupdater

# Commands
## Commands

<!-- commands -->
* [`oclif-example install [VERSION]`](#oclif-example-install-version)
* [`oclif-example update [CHANNEL]`](#oclif-example-update-channel)
Expand Down
12 changes: 11 additions & 1 deletion src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down
14 changes: 11 additions & 3 deletions src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> = {
autoupdate: flags.boolean({ hidden: true }),
Expand Down
12 changes: 11 additions & 1 deletion src/commands/use.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down

0 comments on commit 1066934

Please sign in to comment.