Skip to content

Commit 4bd1bd7

Browse files
author
Marco Franceschi
committed
chore: Updated docs for plugins commands
1 parent 3747df9 commit 4bd1bd7

13 files changed

Lines changed: 218 additions & 227 deletions

File tree

README.md

Lines changed: 181 additions & 200 deletions
Large diffs are not rendered by default.

src/commands/add/policy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import OperationBaseCommand from '../operation'
55
export default class AddPolicy extends OperationBaseCommand {
66
static description = 'Add new policy packs'
77

8+
static aliases = ['add:pp']
9+
810
static examples = [
9-
'$ cg policy add aws-cis-1.2.0',
10-
'$ cg policy add aws-cis-1.2.0@0.12.0',
11+
'$ cg add policy aws-cis-1.2.0',
12+
'$ cg add policy aws-cis-1.2.0@0.12.0',
1113
]
1214

1315
static strict = false

src/commands/add/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import OperationBaseCommand from '../operation'
55
export default class AddProvider extends OperationBaseCommand {
66
static description = 'Add new providers'
77

8-
static aliases = ['add']
8+
static aliases = ['add:p']
99

10-
static examples = ['$ cg provider add aws', '$ cg provider add aws@0.12.0']
10+
static examples = ['$ cg add provider aws', '$ cg add provider aws@0.12.0']
1111

1212
static strict = false
1313

src/commands/install/policy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import OperationBaseCommand from '../operation'
55
export default class InstallPolicy extends OperationBaseCommand {
66
static description = 'Install policy packs based on the lock file'
77

8-
static examples = ['$ cg policy install']
8+
static aliases = ['install:pp']
9+
10+
static examples = ['$ cg install policy']
911

1012
static strict = false
1113

src/commands/install/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import OperationBaseCommand from '../operation'
55
export default class InstallProvider extends OperationBaseCommand {
66
static description = 'Install providers based on the lock file'
77

8-
static aliases = ['install']
8+
static aliases = ['install:p']
99

10-
static examples = ['$ cg provider install']
10+
static examples = ['$ cg install provider']
1111

1212
static strict = false
1313

src/commands/list/policy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import OperationBaseCommand from '../operation'
55
export default class ListPolicy extends OperationBaseCommand {
66
static description = 'List currently installed policy packs and versions'
77

8-
static examples = ['$ cg policy list', '$ cg policy list aws']
8+
static aliases = ['ls:policy', 'list:pp', 'ls:pp']
9+
10+
static examples = ['$ cg list policy', '$ cg list policy aws']
911

1012
static strict = false
1113

src/commands/list/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import OperationBaseCommand from '../operation'
55
export default class ListProvider extends OperationBaseCommand {
66
static description = 'List currently installed providers and versions'
77

8-
static aliases = ['provider:ls', 'list', 'ls']
8+
static aliases = ['ls:provider', 'list:p', 'ls:p']
99

10-
static examples = ['$ cg provider list', '$ cg provider list aws']
10+
static examples = ['$ cg list provider', '$ cg list provider aws']
1111

1212
static strict = false
1313

src/commands/operation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export default abstract class OperationBaseCommand extends Command {
218218
}
219219
const pluginsToList =
220220
allPlugins.length >= 1
221-
? pickBy(lockFile, (_, key) => {
221+
? pickBy(lockFile?.[type], (_, key) => {
222222
return allPlugins.includes(key)
223223
})
224224
: lockFile?.[type] || {}

src/commands/remove/policy.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import { PluginType } from '@cloudgraph/sdk'
22

33
import OperationBaseCommand from '../operation'
44

5-
export default class Remove extends OperationBaseCommand {
5+
export default class RemovePolicy extends OperationBaseCommand {
66
static description = 'Remove currently installed policy pack'
77

8+
static aliases = ['remove:pp', 'rm:pp', 'del:pp', 'rm:policy', 'del:policy']
9+
810
static examples = [
9-
'$ cg policy delete',
10-
'$ cg policy delete aws-cis-1.2.0',
11-
'$ cg policy delete aws-cis-1.2.0 --no-save',
11+
'$ cg delete policy',
12+
'$ cg delete policy aws-cis-1.2.0',
13+
'$ cg delete policy aws-cis-1.2.0 --no-save',
1214
]
1315

1416
static strict = false

src/commands/remove/provider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import OperationBaseCommand from '../operation'
55
export default class RemoveProvider extends OperationBaseCommand {
66
static description = 'Remove currently installed provider'
77

8-
static aliases = ['remove', 'rm', 'del', 'provider:rm', 'provider:del']
8+
static aliases = ['remove:p', 'rm:p', 'del:p', 'rm:provider', 'del:provider']
99

1010
static examples = [
11-
'$ cg provider delete',
12-
'$ cg provider delete aws',
13-
'$ cg provider delete aws --no-save',
11+
'$ cg delete provider',
12+
'$ cg delete provider aws',
13+
'$ cg delete provider aws --no-save',
1414
]
1515

1616
static strict = false

0 commit comments

Comments
 (0)