Skip to content

Commit

Permalink
fix: use templates for examples (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley authored Nov 13, 2023
1 parent 93fa155 commit c2a3f43
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/commands/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class PluginsIndex extends Command {
static description = 'List installed plugins.'
static enableJsonFlag = true

static examples = ['$ <%- config.bin %> plugins']
static examples = ['<%= config.bin %> <%= command.id %>']

static flags = {
core: Flags.boolean({description: 'Show core plugins.'}),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/plugins/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class PluginsInspect extends Command {

static enableJsonFlag = true

static examples = ['$ <%= config.bin %> plugins:inspect <%- config.pjson.oclif.examplePlugin || "myplugin" %> ']
static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> ']

static flags = {
help: Flags.help({char: 'h'}),
Expand Down
6 changes: 3 additions & 3 deletions src/commands/plugins/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ e.g. If you have a core plugin that has a 'hello' command, installing a user-ins
public static enableJsonFlag = true

static examples = [
'$ <%= config.bin %> plugins:install <%- config.pjson.oclif.examplePlugin || "myplugin" %> ',
'$ <%= config.bin %> plugins:install https://github.com/someuser/someplugin',
'$ <%= config.bin %> plugins:install someuser/someplugin',
'<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> ',
'<%= config.bin %> <%= command.id %> https://github.com/someuser/someplugin',
'<%= config.bin %> <%= command.id %> someuser/someplugin',
]

static flags = {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/plugins/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work.
`

static examples = ['$ <%= config.bin %> plugins:link <%- config.pjson.oclif.examplePlugin || "myplugin" %> ']
static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %> ']

static flags = {
help: Flags.help({char: 'h'}),
Expand Down
7 changes: 2 additions & 5 deletions src/commands/plugins/uninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ export default class PluginsUninstall extends Command {

static description = 'Removes a plugin from the CLI.'

static examples = ['<%= config.bin %> <%= command.id %> <%- config.pjson.oclif.examplePlugin || "myplugin" %>']

static flags = {
help: Flags.help({char: 'h'}),
verbose: Flags.boolean({char: 'v'}),
}

static help = `
Example:
$ <%- config.bin %> plugins:uninstall <%- config.pjson.oclif.examplePlugin || "myplugin" %>
`

static strict = false

static usage = 'plugins:uninstall PLUGIN...'
Expand Down

0 comments on commit c2a3f43

Please sign in to comment.