We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 238d729 commit daf0212Copy full SHA for daf0212
1 file changed
src/utils/commands/export/utils.ts
@@ -0,0 +1,27 @@
1
+import { EOL } from 'os'
2
+
3
+export default class ExportUtils {
4
+ constructor() {}
5
6
+ /**
7
+ * CLI flags of 'export' commands
8
+ * Filter 'help' command
9
+ */
10
+ public availableFlags(flags: any) {
11
+ return Object.keys(flags).filter((el, _index, _array) => {
12
+ return el !== 'help'
13
+ })
14
+ }
15
16
17
+ * Format error message
18
19
+ public errorMessage(singularTitle: string, errorList: Array<string>) {
20
+ const plural = (errorList.length > 1) ? 's' : ''
21
+ const title = `${singularTitle}${plural}`
22
+ const details = errorList.map((error: string) => {
23
+ return `• ${error}`
24
+ }).join(EOL)
25
+ return `${title}${EOL}${details}`
26
27
+}
0 commit comments