Skip to content

Commit fd225e3

Browse files
authored
Added examples from /docs to command help menus. (#77)
* Added examples from /docs to command help menus.
1 parent 8674c3c commit fd225e3

87 files changed

Lines changed: 860 additions & 94 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/imodel/populate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ itp imodel populate --imodel-id c2d3e4f5-6789-01ab-cdef-2345678901bc --file site
3333
# Example 3: Synchronizing CSV and IFC Files
3434
itp imodel populate --imodel-id d3e4f5g6-7890-12ab-cdef-3456789012cd --file data1.csv --file data2.csv --file model.ifc
3535

36-
# Example: Synchronizing Revit and DGN Files
36+
# Example 4: Synchronizing Revit and DGN Files
3737
itp imodel populate --imodel-id i9j0k1l2-3456-78ab-cdef-9012345678ij --file model.rvt --file design.dgn
3838
```
3939

docs/user/info.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Retrieve information about specific users based on their user IDs.
1111
## Examples
1212

1313
```bash
14-
# Example: Retrieve information about specific users by their user IDs
14+
# Example 1: Retrieve information about specific users by their user IDs
1515
itp user info --user-id user1-id --user-id user2-id --user-id user3-id
1616
```
1717

src/commands/access-control/group/create.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import BaseCommand from "../../../extensions/base-command.js";
1010
export default class CreateAccessControlGroup extends BaseCommand {
1111
static description = 'Create a new group for an iTwin.';
1212

13+
static examples = [
14+
{
15+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Engineering Team" --description "Group handling engineering tasks"`,
16+
description: 'Example 1:'
17+
}
18+
];
19+
1320
static flags = {
1421
description: Flags.string({
1522
char: 'd',

src/commands/access-control/group/delete.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ import BaseCommand from "../../../extensions/base-command.js";
99

1010
export default class DeleteAccessControlGroup extends BaseCommand {
1111
static description = 'Delete an existing group from an iTwin.';
12-
12+
13+
static examples = [
14+
{
15+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`,
16+
description: 'Example 1:'
17+
}
18+
];
19+
1320
static flags = {
1421
"group-id": Flags.string({
1522
char: 'g',

src/commands/access-control/group/info.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ import BaseCommand from "../../../extensions/base-command.js";
99

1010
export default class AccessControlGroupInfo extends BaseCommand {
1111
static description = 'Retrieve details about a specific group in an iTwin.';
12-
12+
13+
static examples = [
14+
{
15+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`,
16+
description: 'Example 1:'
17+
}
18+
];
19+
1320
static flags = {
1421
"group-id": Flags.string({
1522
char: 'g',

src/commands/access-control/group/list.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ import BaseCommand from "../../../extensions/base-command.js";
99

1010
export default class ListAccessControlGroups extends BaseCommand {
1111
static description = 'List all groups for a specific iTwin.';
12-
12+
13+
static examples = [
14+
{
15+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`,
16+
description: 'Example 1:'
17+
}
18+
];
19+
1320
static flags = {
1421
"itwin-id": Flags.string({
1522
char: 'i',

src/commands/access-control/group/update.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ import BaseCommand from "../../../extensions/base-command.js";
1010
export default class UpdateAccessControlGroup extends BaseCommand {
1111
static description = 'Update the details of an existing group in an iTwin.';
1212

13+
static examples = [
14+
{
15+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --name "Updated Engineering Team" --description "Updated description"`,
16+
description: 'Example 1: Update group name and description'
17+
},
18+
{
19+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --members john.doe@example.com --members jane.doe@example.com --imsGroups "Sample IMS Group" --imsGroups "Sample IMS Group"`,
20+
description: 'Example 2: Update group members and IMS groups'
21+
}
22+
];
23+
1324
static flags = {
1425
description: Flags.string({
1526
char: 'd',

src/commands/access-control/member/group/add.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
* See LICENSE.md in the project root for license terms and full copyright notice.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { Command, Flags } from "@oclif/core";
6+
import { Flags } from "@oclif/core";
77

88
import BaseCommand from "../../../../extensions/base-command.js";
99
import { GroupMember } from "../../../../services/access-control-client/models/group.js";
1010

1111
export default class AddGroupMembers extends BaseCommand {
1212
static description = 'Add one or more groups as members to an iTwin.';
1313

14-
static examples: Command.Example[] = [
14+
static examples = [
1515
{
16-
command: 'itp access-control member group add --itwin-id "ad0ba809-9241-48ad-9eb0-c8038c1a1d51" --groups \'[{"groupId": "group1-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1", "83ee0d80-dea3-495a-b6c0-7bb102ebbcc3"]}, {"groupId": "group2-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1"]}]\',',
17-
description: 'Add one or more groups as members to an iTwin.'
16+
command: `<%= config.bin %> <%= command.id %> --itwin-id "ad0ba809-9241-48ad-9eb0-c8038c1a1d51" --groups '[{"groupId": "group1-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1", "83ee0d80-dea3-495a-b6c0-7bb102ebbcc3"]}, {"groupId": "group2-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1"]}]',`,
17+
description: 'Example 1: Add one or more groups as members to an iTwin.'
1818
}
1919
];
2020

src/commands/access-control/member/group/delete.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ import BaseCommand from "../../../../extensions/base-command.js";
99

1010
export default class DeleteGroupMember extends BaseCommand {
1111
static description = 'Remove a group from an iTwin.';
12-
12+
13+
static examples = [
14+
{
15+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id`,
16+
description: 'Example 1:'
17+
}
18+
];
19+
1320
static flags = {
1421
"group-id": Flags.string({
1522
char: 'g',

src/commands/access-control/member/group/info.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ import BaseCommand from "../../../../extensions/base-command.js";
99

1010
export default class InfoGroupMember extends BaseCommand {
1111
static description = 'Retrieve details about a specific group member in an iTwin.';
12-
12+
13+
static examples = [
14+
{
15+
command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id`,
16+
description: 'Example 1:'
17+
}
18+
];
19+
1320
static flags = {
1421
"group-id": Flags.string({
1522
char: 'g',

0 commit comments

Comments
 (0)