Skip to content

Commit 1f46577

Browse files
committed
fix: review comments
1 parent 31563aa commit 1f46577

File tree

8 files changed

+95
-85
lines changed

8 files changed

+95
-85
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ DESCRIPTION
8181
Display recent changes to a Content Type
8282
8383
EXAMPLES
84-
$ csdx content-type:audit -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
84+
$ csdx content-type:audit --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"
8585
86-
$ csdx content-type:audit -a "management token" -c "home_page"
86+
$ csdx content-type:audit --alias "management token" --content-type "home_page"
8787
```
8888

8989
_See code: [src/commands/content-type/audit.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/audit.ts)_
@@ -109,11 +109,11 @@ DESCRIPTION
109109
Compare two Content Type versions
110110
111111
EXAMPLES
112-
$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
112+
$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"
113113
114-
$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page" -l # -r #
114+
$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page" --left # --right #
115115
116-
$ csdx content-type:compare -a "management token" -c "home_page" -l # -r #
116+
$ csdx content-type:compare --alias "management token" --content-type "home_page" --left # --right #
117117
```
118118

119119
_See code: [src/commands/content-type/compare.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/compare.ts)_
@@ -135,7 +135,7 @@ DESCRIPTION
135135
compare two Content Types on different Stacks
136136
137137
EXAMPLES
138-
$ csdx content-type:compare-remote -o "xxxxxxxxxxxxxxxxxxx" -r "xxxxxxxxxxxxxxxxxxx" -c "home_page"
138+
$ csdx content-type:compare-remote --origin-stack "xxxxxxxxxxxxxxxxxxx" --remote-stack "xxxxxxxxxxxxxxxxxxx" -content-type "home_page"
139139
```
140140

141141
_See code: [src/commands/content-type/compare-remote.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/compare-remote.ts)_
@@ -160,11 +160,11 @@ DESCRIPTION
160160
Display Content Type details
161161
162162
EXAMPLES
163-
$ csdx content-type:details -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
163+
$ csdx content-type:details --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"
164164
165-
$ csdx content-type:details -a "management token" -c "home_page"
165+
$ csdx content-type:details --alias "management token" --content-type "home_page"
166166
167-
$ csdx content-type:details -a "management token" -c "home_page" --no-path
167+
$ csdx content-type:details --alias "management token" --content-type "home_page" --no-path
168168
```
169169

170170
_See code: [src/commands/content-type/details.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/details.ts)_
@@ -193,13 +193,13 @@ DESCRIPTION
193193
Create a visual diagram of a Stack's Content Types
194194
195195
EXAMPLES
196-
$ csdx content-type:diagram -k "xxxxxxxxxxxxxxxxxxx" -o "content-model.svg"
196+
$ csdx content-type:diagram --stack-api-key "xxxxxxxxxxxxxxxxxxx" --output "content-model.svg"
197197
198-
$ csdx content-type:diagram -a "management token" -o "content-model.svg"
198+
$ csdx content-type:diagram --alias "management token" --output "content-model.svg"
199199
200-
$ csdx content-type:diagram -a "management token" -o "content-model.svg" -d "landscape"
200+
$ csdx content-type:diagram --alias "management token" --output "content-model.svg" --direction "landscape"
201201
202-
$ csdx content-type:diagram -a "management token" -o "content-model.dot" -t "dot"
202+
$ csdx content-type:diagram --alias "management token" --output "content-model.dot" --type "dot"
203203
```
204204

205205
_See code: [src/commands/content-type/diagram.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/diagram.ts)_
@@ -224,11 +224,11 @@ DESCRIPTION
224224
List all Content Types in a Stack
225225
226226
EXAMPLES
227-
$ csdx content-type:list -k "xxxxxxxxxxxxxxxxxxx"
227+
$ csdx content-type:list --stack-api-key "xxxxxxxxxxxxxxxxxxx"
228228
229-
$ csdx content-type:list -a "management token"
229+
$ csdx content-type:list --alias "management token"
230230
231-
$ csdx content-type:list -a "management token" -o modified
231+
$ csdx content-type:list --alias "management token" --order modified
232232
```
233233

234234
_See code: [src/commands/content-type/list.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/list.ts)_

package-lock.json

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/content-type/audit.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export default class AuditCommand extends Command {
77
static description = 'Display recent changes to a Content Type'
88

99
static examples = [
10-
'$ csdx content-type:audit -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"',
11-
'$ csdx content-type:audit -a "management token" -c "home_page"'
10+
'$ csdx content-type:audit --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"',
11+
'$ csdx content-type:audit --alias "management token" --content-type "home_page"'
1212
]
1313

1414
static flags: FlagInput = {
@@ -39,7 +39,8 @@ export default class AuditCommand extends Command {
3939
'content-type': flags.string({
4040
char: 'c',
4141
description: 'Content Type UID',
42-
required: true
42+
required: true,
43+
parse: printFlagDeprecation(['-c'], ['--content-type'])
4344
})
4445
}
4546

src/commands/content-type/compare-remote.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
import Command from '../../core/command'
2-
import { flags, FlagInput, managementSDKClient, cliux } from '@contentstack/cli-utilities'
2+
import { flags, FlagInput, managementSDKClient, cliux, printFlagDeprecation } from '@contentstack/cli-utilities'
33
import buildOutput from '../../core/content-type/compare'
44
import { getStack, getContentType } from '../../utils'
55

66
export default class CompareRemoteCommand extends Command {
77
static description = 'compare two Content Types on different Stacks'
88

99
static examples = [
10-
'$ csdx content-type:compare-remote -o "xxxxxxxxxxxxxxxxxxx" -r "xxxxxxxxxxxxxxxxxxx" -c "home_page"'
10+
'$ csdx content-type:compare-remote --origin-stack "xxxxxxxxxxxxxxxxxxx" --remote-stack "xxxxxxxxxxxxxxxxxxx" -content-type "home_page"'
1111
]
1212

1313
static flags: FlagInput = {
1414
'origin-stack': flags.string({
1515
char: 'o',
1616
description: 'Origin Stack API Key',
1717
required: true,
18-
dependsOn: ['remote-stack']
18+
dependsOn: ['remote-stack'],
19+
parse: printFlagDeprecation(['-o'], ['--remote-stack'])
1920
}),
2021

2122
'remote-stack': flags.string({
2223
char: 'r',
2324
description: 'Remote Stack API Key',
2425
required: true,
25-
dependsOn: ['origin-stack']
26+
dependsOn: ['origin-stack'],
27+
parse: printFlagDeprecation(['-r'], ['--remote-stack'])
2628
}),
2729

2830
'content-type': flags.string({
2931
char: 'c',
3032
description: 'Content Type UID',
31-
required: true
33+
required: true,
34+
parse: printFlagDeprecation(['-c'], ['--content-type'])
3235
})
3336
}
3437

src/commands/content-type/compare.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export default class CompareCommand extends Command {
77
static description = 'Compare two Content Type versions'
88

99
static examples = [
10-
'$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"',
11-
'$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page" -l # -r #',
12-
'$ csdx content-type:compare -a "management token" -c "home_page" -l # -r #'
10+
'$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"',
11+
'$ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page" --left # --right #',
12+
'$ csdx content-type:compare --alias "management token" --content-type "home_page" --left # --right #'
1313
]
1414

1515
static flags: FlagInput = {
@@ -40,21 +40,22 @@ export default class CompareCommand extends Command {
4040
'content-type': flags.string({
4141
char: 'c',
4242
description: 'Content Type UID',
43-
required: true
43+
required: true,
44+
parse: printFlagDeprecation(['-c'], ['--content-type'])
4445
}),
4546

4647
left: flags.integer({
4748
char: 'l',
4849
description: 'Content Type version, i.e. prev version',
49-
required: false,
50-
dependsOn: ['right']
50+
dependsOn: ['right'],
51+
parse: printFlagDeprecation(['-l'], ['--left'])
5152
}),
5253

5354
right: flags.integer({
5455
char: 'r',
5556
description: 'Content Type version, i.e. later version',
56-
required: false,
57-
dependsOn: ['left']
57+
dependsOn: ['left'],
58+
parse: printFlagDeprecation(['-r'], ['--right'])
5859
})
5960
}
6061

src/commands/content-type/details.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export default class DetailsCommand extends Command {
77
static description = 'Display Content Type details'
88

99
static examples = [
10-
'$ csdx content-type:details -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"',
11-
'$ csdx content-type:details -a "management token" -c "home_page"',
12-
'$ csdx content-type:details -a "management token" -c "home_page" --no-path'
10+
'$ csdx content-type:details --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"',
11+
'$ csdx content-type:details --alias "management token" --content-type "home_page"',
12+
'$ csdx content-type:details --alias "management token" --content-type "home_page" --no-path'
1313
]
1414

1515
static flags: FlagInput = {
@@ -40,14 +40,16 @@ export default class DetailsCommand extends Command {
4040
'content-type': flags.string({
4141
char: 'c',
4242
description: 'Content Type UID',
43-
required: true
43+
required: true,
44+
parse: printFlagDeprecation(['-c'], ['--content-type'])
4445
}),
4546

4647
path: flags.boolean({
4748
char: 'p',
4849
description: 'show path column',
4950
default: true,
50-
allowNo: true
51+
allowNo: true,
52+
parse: printFlagDeprecation(['-p'], ['--path'])
5153
})
5254
}
5355

0 commit comments

Comments
 (0)