aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/jshipit/Commands.java
blob: 0f0f29c0896b8eee2dc2eeb84d321ab81d5a590f (plain) (blame)
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
// SPDX-License-Identifier: GPL-3.0-only

package io.github.jshipit;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

import java.util.ArrayList;
import java.util.List;

@Parameters(commandDescription = "Open a shell in a container")
class CommandShell {
    @Parameter(names = {"--name", "-n"}, description = "Name of the container", required = true)
    public String containerName;

    @Parameter(names = {"--mount", "-m"}, description = "Mount a directory into the container", required = false)
    public List<String> containerMount = new ArrayList<>();

    @Parameter(names = "--help", help = true)
    private boolean help;
}

@Parameters(commandDescription = "Start a container")
class CommandStart {
    @Parameter(names = {"--name", "-n"}, description = "Name of the container", required = true)
    public String containerName;

    @Parameter(names = {"--command", "-c"}, description = "Command to run in the container", required = false)
    public String containerCommand = null;

    @Parameter(names = {"--mount", "-m"}, description = "Mount a directory into the container", required = false)
    public List<String> containerMount = new ArrayList<>();

    @Parameter(names = "--help", help = true)
    private boolean help;
}

@Parameters(commandDescription = "Create a container")
class CommandCreate {
    @Parameter(names = {"--name", "-n"}, description = "Name of the container")
    public String containerName;

    @Parameter(names = {"--image", "-i"}, description = "Image of the container")
    public String containerImage;

    @Parameter(names = {"--isolated", "-a"}, description = "If the container should be isolated from the host", required = false)
    public boolean containerIsolated = true;

    @Parameter(names = "--help", help = true)
    private boolean help;
}

@Parameters(commandDescription = "Pull a container image")
class CommandPull {
    @Parameter(names = {"--image", "-i"}, description = "Image of the container")
    public String containerImage;

    @Parameter(names = "--help", help = true)
    private boolean help;

}

@Parameters(commandDescription = "Delete a container")
class CommandDelete {
    @Parameter(names = {"--name", "-n"}, description = "Name of the container")
    public String containerName;

    @Parameter(names = "--help", help = true)
    private boolean help;
}