Skip to content

Commit 7a58b96

Browse files
committed
feat: add examples to folder list and move id col to the first position
1 parent 4a61afe commit 7a58b96

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

src/commands/folders/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import {folderId} from '../../flags'
55

66
export default class IndexCommand extends HackMDCommand {
77
static description = 'HackMD folders commands'
8+
static examples = [
9+
`$ hackmd-cli folders
10+
ID Color Description Icon Name Parent Folder ID
11+
──────────────────────────────────── ───── ───────────────────── ───── ─────────── ────────────────────────────────────
12+
91722050-bf47-4334-9e5d-87125a724c29 blue Project documentation 1F600 engineering fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c`,
13+
]
814
static flags = {
915
folderId,
1016
help: Flags.help({char: 'h'}),
@@ -19,12 +25,12 @@ export default class IndexCommand extends HackMDCommand {
1925
const folders = flags.folderId ? [await APIClient.getFolder(flags.folderId)] : await APIClient.getFolderList()
2026

2127
ux.table(folders, {
22-
color: {},
23-
description: {},
24-
icon: {},
2528
id: {
2629
header: 'ID',
2730
},
31+
color: {},
32+
description: {},
33+
icon: {},
2834
name: {},
2935
parentFolderId: {
3036
header: 'Parent Folder ID',

src/commands/team-folders/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import {folderId, teamPath} from '../../flags'
55

66
export default class IndexCommand extends HackMDCommand {
77
static description = 'HackMD team folders commands'
8+
static examples = [
9+
`$ hackmd-cli team-folders --teamPath engineering
10+
ID Color Description Icon Name Parent Folder ID
11+
──────────────────────────────────── ───── ─────────────── ───── ────────── ────────────────────────────────────
12+
91722050-bf47-4334-9e5d-87125a724c29 blue Team handbook 1F600 team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c`,
13+
]
814
static flags = {
915
folderId,
1016
help: Flags.help({char: 'h'}),
@@ -24,12 +30,12 @@ export default class IndexCommand extends HackMDCommand {
2430
const folders = flags.folderId ? [await APIClient.getTeamFolder(flags.teamPath, flags.folderId)] : await APIClient.getTeamFolderList(flags.teamPath)
2531

2632
ux.table(folders, {
27-
color: {},
28-
description: {},
29-
icon: {},
3033
id: {
3134
header: 'ID',
3235
},
36+
color: {},
37+
description: {},
38+
icon: {},
3339
name: {},
3440
parentFolderId: {
3541
header: 'Parent Folder ID',

0 commit comments

Comments
 (0)