diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 2c2b4ae3..eec519c1 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -702,14 +702,14 @@ info: Configuration: {"key":"value","nested":{"field":"data"}} ``` ##### Find a versioned node -To find a specific node in a package by version, use the `--version` option: +To find a specific node in a package by version, use the `--packageVersion` option: ``` -content-cli config nodes get --packageKey --nodeKey --version +content-cli config nodes get --packageKey --nodeKey --packageVersion ``` For example, to find a node in version 1.2.3: ``` -content-cli config nodes get --packageKey my-package --nodeKey my-node --version 1.2.3 +content-cli config nodes get --packageKey my-package --nodeKey my-node --packageVersion 1.2.3 ``` The command will display the node information in the console with the same format as staging nodes: @@ -728,9 +728,9 @@ info: Flavor: STUDIO ``` ##### Find a versioned node with configuration -You can combine the `--version` and `--withConfiguration` options to retrieve a versioned node with its configuration: +You can combine the `--packageVersion` and `--withConfiguration` options to retrieve a versioned node with its configuration: ``` -content-cli config nodes get --packageKey --nodeKey --version --withConfiguration +content-cli config nodes get --packageKey --nodeKey --packageVersion --withConfiguration ``` When configuration is included, it will be displayed as a JSON string in the output: @@ -758,12 +758,12 @@ content-cli config nodes get --packageKey --nodeKey --wit You can also export versioned nodes as JSON: ``` -content-cli config nodes get --packageKey --nodeKey --version --json +content-cli config nodes get --packageKey --nodeKey --packageVersion --json ``` Or combine all options for a versioned node with configuration: ``` -content-cli config nodes get --packageKey --nodeKey --version --withConfiguration --json +content-cli config nodes get --packageKey --nodeKey --packageVersion --withConfiguration --json ``` #### Diffing node configurations diff --git a/src/commands/configuration-management/module.ts b/src/commands/configuration-management/module.ts index 5ad8daa2..d803664e 100644 --- a/src/commands/configuration-management/module.ts +++ b/src/commands/configuration-management/module.ts @@ -77,7 +77,7 @@ class Module extends IModule { .description("Find a specific node in a package") .requiredOption("--packageKey ", "Identifier of the package") .requiredOption("--nodeKey ", "Identifier of the node") - .option("--version ", "Version of the package") + .option("--packageVersion ", "Version of the package") .option("--withConfiguration", "Include node configuration in the response", false) .option("--json", "Return the response as a JSON file") .action(this.findNode); @@ -139,7 +139,7 @@ class Module extends IModule { } private async findNode(context: Context, command: Command, options: OptionValues): Promise { - await new NodeService(context).findNode(options.packageKey, options.nodeKey, options.withConfiguration, options.version ?? null, options.json); + await new NodeService(context).findNode(options.packageKey, options.nodeKey, options.withConfiguration, options.packageVersion ?? null, options.json); } private async diffNode(context: Context, command: Command, options: OptionValues): Promise { diff --git a/src/commands/configuration-management/node.service.ts b/src/commands/configuration-management/node.service.ts index 369bdfff..f0130196 100644 --- a/src/commands/configuration-management/node.service.ts +++ b/src/commands/configuration-management/node.service.ts @@ -11,9 +11,9 @@ export class NodeService { this.nodeApi = new NodeApi(context); } - public async findNode(packageKey: string, nodeKey: string, withConfiguration: boolean, version: string | null, jsonResponse: boolean): Promise { - const node = version - ? await this.nodeApi.findVersionedNodeByKey(packageKey, nodeKey, version, withConfiguration) + public async findNode(packageKey: string, nodeKey: string, withConfiguration: boolean, packageVersion: string | null, jsonResponse: boolean): Promise { + const node = packageVersion + ? await this.nodeApi.findVersionedNodeByKey(packageKey, nodeKey, packageVersion, withConfiguration) : await this.nodeApi.findStagingNodeByKey(packageKey, nodeKey, withConfiguration); if (jsonResponse) {