forked from withfig/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose-up.ts
110 lines (109 loc) · 3.01 KB
/
compose-up.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
const getServices: Fig.Generator = {
script: (context) => {
if (context.includes("-f")) {
const index = context.indexOf("-f");
return `docker-compose -f ${context[index + 1]} config --services`;
}
return "docker-compose config --services";
},
splitOn: "\n",
};
export const completionSpec: Fig.Spec = {
name: "up",
description:
"Builds, (re)creates, starts, and attaches to containers for a service.",
args: [{ generators: getServices }],
options: [
{
name: ["-d", "--detach"],
description:
"Detached mode: Run containers in the background, print new container names. Incompatible with",
},
{
name: ["--no-color"],
description: "Produce monochrome output.",
},
{
name: ["--quiet-pull"],
description: "Pull without printing progress information",
},
{
name: ["--no-deps"],
description: "Don't start linked services.",
},
{
name: ["--force-recreate"],
description:
"Recreate containers even if their configuration and image haven't changed.",
},
{
name: ["--always-recreate-deps"],
description:
"Recreate dependent containers. Incompatible with --no-recreate.",
},
{
name: ["--no-recreate"],
description:
"If containers already exist, don't recreate them. Incompatible with --force-recreate and -V.",
},
{
name: ["--no-build"],
description: "Don't build an image, even if it's missing.",
},
{
name: ["--no-start"],
description: "Don't start the services after creating them.",
},
{
name: ["--build"],
description: "Build images before starting containers.",
},
{
name: ["--abort-on-container-exit"],
description:
"Stops all containers if any container was stopped. Incompatible with -d.",
},
{
name: ["--attach-dependencies"],
description: "Attach to dependent containers.",
},
{
name: ["-t", "--timeout"],
description:
"Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)",
args: {
name: "timeout",
},
},
{
name: ["-V", "--renew-anon-volumes"],
description:
"Recreate anonymous volumes instead of retrieving data from the previous containers.",
},
{
name: ["--remove-orphans"],
description:
"Remove containers for services not defined in the Compose file.",
},
{
name: ["--exit-code-from"],
description:
"Return the exit code of the selected service container. Implies --abort-on-container-exit.",
args: {
name: "service",
},
},
{
name: ["--scale"],
description:
"Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.",
args: {
name: "SERVICE=NUM",
},
},
{
name: "--no-log-prefix",
description: "Don't print prefix in logs.",
},
],
};