Skip to content

Commit

Permalink
Command aliases updated
Browse files Browse the repository at this point in the history
  • Loading branch information
antonyagustine committed Oct 4, 2023
1 parent 64d1f18 commit 7b93351
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 6 deletions.
87 changes: 85 additions & 2 deletions packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ USAGE

# Commands
<!-- commands -->
* [`csdx audit`](#csdx-audit)
* [`csdx audit:fix`](#csdx-auditfix)
* [`csdx cm:stacks:audit`](#csdx-cmstacksaudit)
* [`csdx cm:stacks:audit:fix`](#csdx-cmstacksauditfix)
* [`csdx help [COMMANDS]`](#csdx-help-commands)
Expand All @@ -43,6 +45,85 @@ USAGE
* [`csdx plugins:uninstall PLUGIN...`](#csdx-pluginsuninstall-plugin-2)
* [`csdx plugins:update`](#csdx-pluginsupdate)

## `csdx audit`

Audit and find possible errors in the exported data

```
USAGE
$ csdx audit [-c <value>] [-d <value>] [--report-path <value>] [--modules
content-types|global-fields|entries] [--columns <value> | ] [--sort <value>] [--filter <value>] [--csv |
--no-truncate]
FLAGS
-c, --config=<value> Path of the external config
-d, --data-dir=<value> Path and location where data is stored
--columns=<value> only show provided columns (comma-separated)
--csv output is csv format [alias: --output=csv]
--filter=<value> filter property by partial string matching, ex: name=foo
--modules=<option>... Provide list of modules to be audited
<options: content-types|global-fields|entries>
--no-truncate do not truncate output to fit screen
--report-path=<value> Path to store the audit reports
--sort=<value> property to sort by (prepend '-' for descending)
DESCRIPTION
Audit and find possible errors in the exported data
ALIASES
$ csdx audit
$ csdx cm:stacks:audit
EXAMPLES
$ csdx audit
$ csdx audit --report-path=<path>
$ csdx audit --report-path=<path> --csv
$ csdx audit --report-path=<path> --filter="name=<filter-value>"
$ csdx audit --report-path=<path> --modules=content-types --filter="name="<filter-value>"
```

## `csdx audit:fix`

Audit and fix possible errors in the exported data

```
USAGE
$ csdx audit:fix [-c <value>] [-d <value>] [--report-path <value>] [--modules
content-types|global-fields|entries] [--backup-dir <value> --backup-data] [-y]
FLAGS
-c, --config=<value> Path of the external config
-d, --data-dir=<value> Path and location where data is stored
-y, --yes Use this flag to skip confirmation
--backup-data Create backup from original data
--backup-dir=<value> Provided path to backup original data
--modules=<option>... Provide list of modules to be audited
<options: content-types|global-fields|entries>
--report-path=<value> Path to store the audit reports
DESCRIPTION
Audit and fix possible errors in the exported data
ALIASES
$ csdx audit:fix
$ csdx cm:stacks:audit:fix
EXAMPLES
$ csdx audit:fix
$ csdx audit:fix --report-path=<path>
$ csdx audit:fix --report-path=<path> --csv
$ csdx audit:fix --report-path=<path> --filter="name=<filter-value>"
$ csdx audit:fix --report-path=<path> --modules=content-types --filter="name="<filter-value>"
```

## `csdx cm:stacks:audit`

Audit and find possible errors in the exported data
Expand All @@ -69,6 +150,7 @@ DESCRIPTION
Audit and find possible errors in the exported data
ALIASES
$ csdx audit
$ csdx cm:stacks:audit
EXAMPLES
Expand All @@ -87,7 +169,7 @@ _See code: [src/commands/cm/stacks/audit/index.ts](https://github.com/contentsta

## `csdx cm:stacks:audit:fix`

Audit and find possible errors in the exported data and fix
Audit and fix possible errors in the exported data

```
USAGE
Expand All @@ -105,9 +187,10 @@ FLAGS
--report-path=<value> Path to store the audit reports
DESCRIPTION
Audit and find possible errors in the exported data and fix
Audit and fix possible errors in the exported data
ALIASES
$ csdx audit:fix
$ csdx cm:stacks:audit:fix
EXAMPLES
Expand Down
5 changes: 4 additions & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
],
"topics": {
"cm:stacks:audit": {
"description": "Audit and find possible refrence errors in the exported data"
"description": "Audit and find possible errors in the exported data"
},
"cm:stacks:audit:fix": {
"description": "Audit and fix possible errors in the exported data"
}
},
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-audit/<%- commandPath %>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { auditFixMsg, auditMsg } from '../../../../messages';
import { AuditBaseCommand } from '../../../../audit-base-command';

export default class AuditFix extends AuditBaseCommand {
static aliases: string[] = ['cm:stacks:audit:fix'];
static aliases: string[] = ['audit:fix', 'cm:stacks:audit:fix'];

static description = 'Audit and find possible errors in the exported data and fix';
static description = 'Audit and fix possible errors in the exported data';

static examples = [
'$ <%= config.bin %> <%= command.id %>',
Expand Down Expand Up @@ -41,6 +41,9 @@ export default class AuditFix extends AuditBaseCommand {
char: 'y',
description: 'Use this flag to skip confirmation',
}),
...ux.table.flags({
only: ['columns', 'sort', 'filter', 'csv', 'no-truncate'],
}),
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { auditMsg } from '../../../../messages';
import { AuditBaseCommand } from '../../../../audit-base-command';

export default class Audit extends AuditBaseCommand {
static aliases: string[] = ['cm:stacks:audit'];
static aliases: string[] = ['audit', 'cm:stacks:audit'];

static description = 'Audit and find possible errors in the exported data';

Expand Down

0 comments on commit 7b93351

Please sign in to comment.