We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfffcbf commit d78b43cCopy full SHA for d78b43c
9 files changed
src/commands/notes/create.ts
@@ -2,6 +2,7 @@ import {CommentPermissionType, CreateNoteOptions, NotePermissionRole} from '@hac
2
import {CliUx, Command, Flags} from '@oclif/core'
3
4
import {APIClient} from '../../api'
5
+import {commentPermission, noteContent, notePermission, noteTitle} from '../../flags'
6
import readStdin from '../../read-stdin-stream'
7
8
export default class Create extends Command {
@@ -20,11 +21,11 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q
20
21
22
static flags = {
23
help: Flags.help({char: 'h'}),
- title: Flags.string(),
24
- content: Flags.string(),
25
- readPermission: Flags.string(),
26
- writePermission: Flags.string(),
27
- commentPermission: Flags.string(),
+ title: noteTitle(),
+ content: noteContent(),
+ readPermission: notePermission(),
+ writePermission: notePermission(),
28
+ commentPermission: commentPermission(),
29
...CliUx.ux.table.flags(),
30
}
31
src/commands/notes/delete.ts
@@ -1,6 +1,7 @@
1
import {Command, Flags} from '@oclif/core'
+import {noteId} from '../../flags'
export default class Delete extends Command {
static description = 'Delete a note'
@@ -11,7 +12,7 @@ export default class Delete extends Command {
11
12
13
14
- noteId: Flags.string(),
15
+ noteId: noteId(),
16
17
18
async run() {
src/commands/notes/index.ts
export default class IndexCommand extends Command {
static description = 'HackMD notes commands'
@@ -14,7 +15,7 @@ raUuSTetT5uQbqQfLnz9lA CLI test note gvfz2UB5THiKABQJQnLs6Q n
19
src/commands/notes/update.ts
+import {noteContent, noteId} from '../../flags'
export default class Update extends Command {
static description = 'Update note content'
@@ -11,8 +12,8 @@ export default class Update extends Command {
- content: Flags.string()
+ content: noteContent()
src/commands/team-notes/create.ts
+import {commentPermission, noteContent, notePermission, noteTitle, teamPath} from '../../flags'
@@ -19,12 +20,12 @@ raUuSTetT5uQbqQfLnz9lA A new note gvfz2UB5THiKABQJQnLs6Q n
- teamPath: Flags.string(),
+ teamPath: teamPath(),
src/commands/team-notes/delete.ts
+import {noteId, teamPath} from '../../flags'
static description = 'Delete a team note'
@@ -11,8 +12,8 @@ export default class Delete extends Command {
src/commands/team-notes/index.ts
+import {teamPath} from '../../flags'
static description = 'HackMD team-notes commands'
@@ -15,7 +16,7 @@ BnC6gN0_TfStV2KKmPPXeg Welcome to your team's workspace null CLI-test`,
src/commands/team-notes/update.ts
+import {noteContent, noteId, teamPath} from '../../flags'
static description = 'Update team note content'
@@ -11,9 +12,9 @@ export default class Update extends Command {
src/flags.ts
@@ -0,0 +1,24 @@
+import {Flags} from '@oclif/core'
+export const noteId = Flags.build({
+ description: 'hackmd note id'
+})
+
+export const teamPath = Flags.build({
+ description: 'hackmd team path'
9
10
+export const noteContent = Flags.build({
+ description: 'new note content'
+export const noteTitle = Flags.build({
+ description: 'new note title'
+export const notePermission = Flags.build({
+ description: 'set note permission: owner, signed_in, guest'
+export const commentPermission = Flags.build({
+ description: 'set comment permission: disabled, forbidden, owners, signed_in_users, everyone'
0 commit comments