Skip to content

Commit de88b57

Browse files
committed
standardizing command flags
1 parent 12054da commit de88b57

File tree

8 files changed

+31
-28
lines changed

8 files changed

+31
-28
lines changed

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
contentstack-cli-content-type
2-
===
1+
![Node.js CI](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/workflows/Node.js%20CI/badge.svg)
2+
![npm](https://img.shields.io/npm/v/contentstack-cli-content-type)
33

44
## Description
55
This is a plugin for [Contentstack's](https://www.contentstack.com/) CLI.
@@ -12,16 +12,20 @@ $ csdx plugins:install contentstack-cli-content-type
1212
```
1313

1414
## How to use this plugin
15-
This plugin requires you to be authenticated using `csdx auth:login`.
16-
Several commands, such as `csdx content-type:compare` support management token aliases a input flag.
17-
These commands only use the **Stack API Key**.
18-
They are provided as a convenience, so the Stack API Key's do not have to be re-typed.
19-
The management token associated with the Stack API Key is ignored.
15+
This plugin requires you to be authenticated using [csdx auth:login](https://www.contentstack.com/docs/developers/cli/authenticate-with-the-cli/).
2016

21-
<!-- toc -->
22-
* [Commands](#commands)
23-
<!-- tocstop -->
17+
Several commands, such as `csdx content-type:compare` support token aliases as input.
18+
These token aliases should be created using `csdx auth:tokens:add`.
2419

20+
The commands only use the **Stack API Key**. The management token is ignored.
21+
They are provided as a convenience, so the Stack API Keys do not have to be re-typed.
22+
23+
## Usability
24+
The `csdx content-type:details` command requires a wide terminal window. If the `path` column is not needed, you can hide it:
25+
26+
```shell
27+
$ csdx content-type:details -a "management token" -c "content type" --no-path
28+
```
2529
<!-- usagestop -->
2630
# Commands
2731
<!-- commands -->
@@ -42,7 +46,7 @@ USAGE
4246
OPTIONS
4347
-a, --token-alias=token-alias management token alias
4448
-c, --content-type=content-type (required) Content Type UID
45-
-s, --stack=stack stack uid
49+
-s, --stack=stack Stack UID
4650
4751
EXAMPLES
4852
$ csdx content-type:audit -s "xxxxxxxxxxxxxxxxxxx" -c "home_page"
@@ -64,7 +68,7 @@ OPTIONS
6468
-c, --content-type=content-type (required) Content Type UID
6569
-l, --left=left Content Type version, i.e. prev version
6670
-r, --right=right Content Type version, i.e. later version
67-
-s, --stack=stack stack uid
71+
-s, --stack=stack Stack UID
6872
6973
EXAMPLES
7074
$ csdx content-type:compare -s "xxxxxxxxxxxxxxxxxxx" -c "home_page"
@@ -76,16 +80,16 @@ _See code: [src/commands/content-type/compare.ts](https://github.com/Contentstac
7680

7781
## `csdx content-type:compare-remote`
7882

79-
compare two Content Types on different stacks
83+
compare two Content Types on different Stacks
8084

8185
```
8286
USAGE
8387
$ csdx content-type:compare-remote
8488
8589
OPTIONS
8690
-c, --content-type=content-type (required) Content Type UID
87-
-o, --origin-stack=origin-stack origin stack uid
88-
-r, --remote-stack=remote-stack remote stack uid
91+
-o, --origin-stack=origin-stack (required) origin Stack UID
92+
-r, --remote-stack=remote-stack (required) remote Stack UID
8993
9094
EXAMPLE
9195
$ csdx content-type:compare-remote -o "xxxxxxxxxxxxxxxxxxx" -r "xxxxxxxxxxxxxxxxxxx" -c "home_page"
@@ -105,7 +109,7 @@ OPTIONS
105109
-a, --token-alias=token-alias management token alias
106110
-c, --content-type=content-type (required) Content Type UID
107111
-p, --[no-]path show path column
108-
-s, --stack=stack stack uid
112+
-s, --stack=stack Stack UID
109113
110114
EXAMPLES
111115
$ csdx content-type:details -s "xxxxxxxxxxxxxxxxxxx" -c "home_page"
@@ -126,7 +130,7 @@ USAGE
126130
OPTIONS
127131
-a, --token-alias=token-alias management token alias
128132
-o, --order=title|modified [default: title] order by column
129-
-s, --stack=stack stack uid
133+
-s, --stack=stack Stack UID
130134
131135
EXAMPLES
132136
$ csdx content-type:list -s "xxxxxxxxxxxxxxxxxxx"

oclif.manifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/commands/content-type/audit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class AuditCommand extends Command {
1414
static flags = {
1515
stack: flags.string({
1616
char: 's',
17-
description: 'stack uid',
17+
description: 'Stack UID',
1818
required: false,
1919
exclusive: ['token-alias'],
2020
}),

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import cli from 'cli-ux'
44
import buildOutput from '../../core/content-type/compare'
55

66
export default class CompareRemoteCommand extends Command {
7-
static description = 'compare two Content Types on different stacks';
7+
static description = 'compare two Content Types on different Stacks';
88

99
static examples = [
1010
'$ csdx content-type:compare-remote -o "xxxxxxxxxxxxxxxxxxx" -r "xxxxxxxxxxxxxxxxxxx" -c "home_page"',
@@ -13,15 +13,15 @@ export default class CompareRemoteCommand extends Command {
1313
static flags = {
1414
'origin-stack': flags.string({
1515
char: 'o',
16-
description: 'origin stack uid',
17-
required: false,
16+
description: 'origin Stack UID',
17+
required: true,
1818
dependsOn: ['remote-stack'],
1919
}),
2020

2121
'remote-stack': flags.string({
2222
char: 'r',
23-
description: 'remote stack uid',
24-
required: false,
23+
description: 'remote Stack UID',
24+
required: true,
2525
dependsOn: ['origin-stack'],
2626
}),
2727

src/commands/content-type/compare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class CompareCommand extends Command {
1515
static flags = {
1616
stack: flags.string({
1717
char: 's',
18-
description: 'stack uid',
18+
description: 'Stack UID',
1919
required: false,
2020
exclusive: ['token-alias'],
2121
}),

src/commands/content-type/details.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class DetailsCommand extends Command {
1515
static flags = {
1616
stack: flags.string({
1717
char: 's',
18-
description: 'stack uid',
18+
description: 'Stack UID',
1919
required: false,
2020
exclusive: ['token-alias'],
2121
}),

src/commands/content-type/list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class ListCommand extends Command {
1515
static flags = {
1616
stack: flags.string({
1717
char: 's',
18-
description: 'stack uid',
18+
description: 'Stack UID',
1919
required: false,
2020
exclusive: ['token-alias'],
2121
multiple: false,

src/core/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class ContentTypeCommand extends Command {
3434
}
3535

3636
printOutput(output: BuildOutput, who: string, what: string | null, where: string) {
37-
this.log(`Requested ${who}${what ? ` for ${what} ` : ' '}on '${where}.'`)
37+
this.log(`Requested ${who}${what ? ` for '${what}' ` : ' '}on '${where}.'`)
3838
this.log('---\n')
3939

4040
if (output.hasResults) {

0 commit comments

Comments
 (0)