/
epilogue.ts
67 lines (65 loc) · 2.3 KB
/
epilogue.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Add new examples here.
// Always start with `$ $0` so that it a) symbolizes a command line; and b) $0 gets replaced by the binary name uniformly.
const examples = [
{
description: 'Output nothing more than stdout+stderr of child processes',
example: '$ $0 --raw "npm run watch-less" "npm run watch-js"'
},
{
description: 'Normal output but without colors e.g. when logging to file',
example: '$ $0 --no-color "grunt watch" "http-server" > log'
},
{
description: 'Custom prefix',
example: '$ $0 --prefix "{time}-{pid}" "npm run watch" "http-server"',
},
{
description: 'Custom names and colored prefixes',
example: '$ $0 --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold" "http-server" "npm run watch"',
},
{
description: 'Configuring via environment variables with CONCURRENTLY_ prefix',
example: '$ CONCURRENTLY_RAW=true CONCURRENTLY_KILL_OTHERS=true $0 "echo hello" "echo world"',
},
{
description: 'Send input to default',
example: [
'$ $0 --handle-input "nodemon" "npm run watch-js"',
'rs # Sends rs command to nodemon process'
].join('\n'),
},
{
description: 'Send input to specific child identified by index',
example: [
'$ $0 --handle-input "npm run watch-js" nodemon',
'1:rs'
].join('\n'),
},
{
description: 'Send input to specific child identified by name',
example: [
'$ $0 --handle-input -n js,srv "npm run watch-js" nodemon',
'srv:rs'
].join('\n'),
},
{
description: 'Shortened NPM run commands',
example: '$ $0 npm:watch-node npm:watch-js npm:watch-css',
},
{
description: 'Shortened NPM run command with wildcard (make sure to wrap it in quotes!)',
example: '$ $0 "npm:watch-*"',
},
{
description: 'Exclude patterns so that between "lint:js" and "lint:fix:js", only "lint:js" is ran',
example: '$ $0 "npm:*(!fix)"'
}
];
export const epilogue = `
Examples:
${examples.map(({ example, description }) => `
- ${description}
${example.split('\n').map(line => ` ${line}`).join('\n')}
`).join('')}
For more details, visit https://github.com/open-cli-tools/concurrently
`;