Skip to content

Commit cbc3dac

Browse files
author
Ma Shimiao
committed
sort options list by letter
Signed-off-by: Ma Shimiao <[email protected]>
1 parent 089d971 commit cbc3dac

4 files changed

Lines changed: 79 additions & 79 deletions

File tree

cmd/ocitools/generate.go

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,65 +13,65 @@ import (
1313
)
1414

1515
var generateFlags = []cli.Flag{
16-
cli.StringFlag{Name: "output", Usage: "output file (defaults to stdout)"},
17-
cli.StringFlag{Name: "rootfs", Value: "rootfs", Usage: "path to the rootfs"},
18-
cli.BoolFlag{Name: "read-only", Usage: "make the container's rootfs read-only"},
19-
cli.BoolFlag{Name: "privileged", Usage: "enable privileged container settings"},
20-
cli.BoolFlag{Name: "no-new-privileges", Usage: "set no new privileges bit for the container process"},
21-
cli.BoolFlag{Name: "tty", Usage: "allocate a new tty for the container process"},
22-
cli.StringFlag{Name: "hostname", Usage: "hostname value for the container"},
23-
cli.IntFlag{Name: "uid", Usage: "uid for the process"},
24-
cli.IntFlag{Name: "gid", Usage: "gid for the process"},
25-
cli.StringSliceFlag{Name: "groups", Usage: "supplementary groups for the process"},
16+
cli.StringFlag{Name: "apparmor", Usage: "specifies the the apparmor profile for the container"},
17+
cli.StringFlag{Name: "arch", Value: runtime.GOARCH, Usage: "architecture the container is created for"},
18+
cli.StringSliceFlag{Name: "args", Usage: "command to run in the container"},
19+
cli.StringSliceFlag{Name: "bind", Usage: "bind mount directories src:dest:(rw,ro)"},
2620
cli.StringSliceFlag{Name: "cap-add", Usage: "add Linux capabilities"},
2721
cli.StringSliceFlag{Name: "cap-drop", Usage: "drop Linux capabilities"},
2822
cli.StringFlag{Name: "cgroup", Usage: "cgroup namespace"},
29-
cli.StringFlag{Name: "network", Usage: "network namespace"},
30-
cli.StringFlag{Name: "mount", Usage: "mount namespace"},
31-
cli.StringFlag{Name: "pid", Usage: "pid namespace"},
32-
cli.StringFlag{Name: "ipc", Usage: "ipc namespace"},
33-
cli.StringFlag{Name: "user", Usage: "user namespace"},
34-
cli.StringFlag{Name: "uts", Usage: "uts namespace"},
35-
cli.StringFlag{Name: "selinux-label", Usage: "process selinux label"},
36-
cli.StringFlag{Name: "mount-label", Usage: "selinux mount context label"},
37-
cli.StringSliceFlag{Name: "tmpfs", Usage: "mount tmpfs"},
38-
cli.StringSliceFlag{Name: "args", Usage: "command to run in the container"},
39-
cli.StringSliceFlag{Name: "env", Usage: "add environment variable e.g. key=value"},
4023
cli.StringFlag{Name: "cgroups-path", Usage: "specify the path to the cgroups"},
41-
cli.StringFlag{Name: "mount-cgroups", Value: "no", Usage: "mount cgroups (rw,ro,no)"},
42-
cli.StringSliceFlag{Name: "bind", Usage: "bind mount directories src:dest:(rw,ro)"},
43-
cli.StringSliceFlag{Name: "prestart", Usage: "path to prestart hooks"},
44-
cli.StringSliceFlag{Name: "poststart", Usage: "path to poststart hooks"},
45-
cli.StringSliceFlag{Name: "poststop", Usage: "path to poststop hooks"},
46-
cli.StringFlag{Name: "root-propagation", Usage: "mount propagation for root"},
47-
cli.StringFlag{Name: "os", Value: runtime.GOOS, Usage: "operating system the container is created for"},
48-
cli.StringFlag{Name: "arch", Value: runtime.GOARCH, Usage: "architecture the container is created for"},
4924
cli.StringFlag{Name: "cwd", Value: "/", Usage: "current working directory for the process"},
50-
cli.StringSliceFlag{Name: "uidmappings", Usage: "add UIDMappings e.g HostID:ContainerID:Size"},
25+
cli.StringSliceFlag{Name: "env", Usage: "add environment variable e.g. key=value"},
26+
cli.IntFlag{Name: "gid", Usage: "gid for the process"},
5127
cli.StringSliceFlag{Name: "gidmappings", Usage: "add GIDMappings e.g HostID:ContainerID:Size"},
52-
cli.StringSliceFlag{Name: "sysctl", Usage: "add sysctl settings e.g net.ipv4.forward=1"},
53-
cli.StringFlag{Name: "apparmor", Usage: "specifies the the apparmor profile for the container"},
54-
cli.StringFlag{Name: "seccomp-default", Usage: "specifies the the defaultaction of Seccomp syscall restrictions"},
55-
cli.StringSliceFlag{Name: "seccomp-arch", Usage: "specifies Additional architectures permitted to be used for system calls"},
56-
cli.StringSliceFlag{Name: "seccomp-syscalls", Usage: "specifies Additional architectures permitted to be used for system calls, e.g Name:Action:Arg1_index/Arg1_value/Arg1_valuetwo/Arg1_op, Arg2_index/Arg2_value/Arg2_valuetwo/Arg2_op "},
57-
cli.StringSliceFlag{Name: "seccomp-allow", Usage: "specifies syscalls to be added to allowed"},
58-
cli.StringSliceFlag{Name: "seccomp-errno", Usage: "specifies syscalls to be added to list that returns an error"},
59-
cli.StringFlag{Name: "template", Usage: "base template to use for creating the configuration"},
28+
cli.StringSliceFlag{Name: "groups", Usage: "supplementary groups for the process"},
29+
cli.StringFlag{Name: "hostname", Usage: "hostname value for the container"},
30+
cli.StringFlag{Name: "ipc", Usage: "ipc namespace"},
6031
cli.StringSliceFlag{Name: "label", Usage: "add annotations to the configuration e.g. key=value"},
61-
cli.IntFlag{Name: "oom-score-adj", Usage: "oom_score_adj for the container"},
6232
cli.Uint64Flag{Name: "linux-cpu-shares", Usage: "the relative share of CPU time available to the tasks in a cgroup"},
6333
cli.Uint64Flag{Name: "linux-cpu-period", Usage: "the CPU period to be used for hardcapping (in usecs)"},
6434
cli.Uint64Flag{Name: "linux-cpu-quota", Usage: "the allowed CPU time in a given period (in usecs)"},
65-
cli.Uint64Flag{Name: "linux-realtime-runtime", Usage: "the time realtime scheduling may use (in usecs)"},
66-
cli.Uint64Flag{Name: "linux-realtime-period", Usage: "CPU period to be used for realtime scheduling (in usecs)"},
6735
cli.StringFlag{Name: "linux-cpus", Usage: "CPUs to use within the cpuset (default is to use any CPU available)"},
68-
cli.StringFlag{Name: "linux-mems", Usage: "list of memory nodes in the cpuset (default is to use any available memory node)"},
36+
cli.Uint64Flag{Name: "linux-mem-kernel-limit", Usage: "kernel memory limit (in bytes)"},
37+
cli.Uint64Flag{Name: "linux-mem-kernel-tcp", Usage: "kernel memory limit for tcp (in bytes)"},
6938
cli.Uint64Flag{Name: "linux-mem-limit", Usage: "memory limit (in bytes)"},
7039
cli.Uint64Flag{Name: "linux-mem-reservation", Usage: "memory reservation or soft limit (in bytes)"},
7140
cli.Uint64Flag{Name: "linux-mem-swap", Usage: "total memory limit (memory + swap) (in bytes)"},
72-
cli.Uint64Flag{Name: "linux-mem-kernel-limit", Usage: "kernel memory limit (in bytes)"},
73-
cli.Uint64Flag{Name: "linux-mem-kernel-tcp", Usage: "kernel memory limit for tcp (in bytes)"},
7441
cli.Uint64Flag{Name: "linux-mem-swappiness", Usage: "how aggressive the kernel will swap memory pages (Range from 0 to 100)"},
42+
cli.StringFlag{Name: "linux-mems", Usage: "list of memory nodes in the cpuset (default is to use any available memory node)"},
43+
cli.Uint64Flag{Name: "linux-realtime-period", Usage: "CPU period to be used for realtime scheduling (in usecs)"},
44+
cli.Uint64Flag{Name: "linux-realtime-runtime", Usage: "the time realtime scheduling may use (in usecs)"},
45+
cli.StringFlag{Name: "mount", Usage: "mount namespace"},
46+
cli.StringFlag{Name: "mount-cgroups", Value: "no", Usage: "mount cgroups (rw,ro,no)"},
47+
cli.StringFlag{Name: "mount-label", Usage: "selinux mount context label"},
48+
cli.StringFlag{Name: "network", Usage: "network namespace"},
49+
cli.BoolFlag{Name: "no-new-privileges", Usage: "set no new privileges bit for the container process"},
50+
cli.IntFlag{Name: "oom-score-adj", Usage: "oom_score_adj for the container"},
51+
cli.StringFlag{Name: "os", Value: runtime.GOOS, Usage: "operating system the container is created for"},
52+
cli.StringFlag{Name: "output", Usage: "output file (defaults to stdout)"},
53+
cli.StringFlag{Name: "pid", Usage: "pid namespace"},
54+
cli.StringSliceFlag{Name: "poststart", Usage: "path to poststart hooks"},
55+
cli.StringSliceFlag{Name: "poststop", Usage: "path to poststop hooks"},
56+
cli.StringSliceFlag{Name: "prestart", Usage: "path to prestart hooks"},
57+
cli.BoolFlag{Name: "privileged", Usage: "enable privileged container settings"},
58+
cli.BoolFlag{Name: "read-only", Usage: "make the container's rootfs read-only"},
59+
cli.StringFlag{Name: "root-propagation", Usage: "mount propagation for root"},
60+
cli.StringFlag{Name: "rootfs", Value: "rootfs", Usage: "path to the rootfs"},
61+
cli.StringSliceFlag{Name: "seccomp-arch", Usage: "specifies Additional architectures permitted to be used for system calls"},
62+
cli.StringSliceFlag{Name: "seccomp-allow", Usage: "specifies syscalls to be added to allowed"},
63+
cli.StringFlag{Name: "seccomp-default", Usage: "specifies the the defaultaction of Seccomp syscall restrictions"},
64+
cli.StringSliceFlag{Name: "seccomp-errno", Usage: "specifies syscalls to be added to list that returns an error"},
65+
cli.StringSliceFlag{Name: "seccomp-syscalls", Usage: "specifies Additional architectures permitted to be used for system calls, e.g Name:Action:Arg1_index/Arg1_value/Arg1_valuetwo/Arg1_op, Arg2_index/Arg2_value/Arg2_valuetwo/Arg2_op "},
66+
cli.StringFlag{Name: "selinux-label", Usage: "process selinux label"},
67+
cli.StringSliceFlag{Name: "sysctl", Usage: "add sysctl settings e.g net.ipv4.forward=1"},
68+
cli.StringFlag{Name: "template", Usage: "base template to use for creating the configuration"},
69+
cli.StringSliceFlag{Name: "tmpfs", Usage: "mount tmpfs"},
70+
cli.BoolFlag{Name: "tty", Usage: "allocate a new tty for the container process"},
71+
cli.IntFlag{Name: "uid", Usage: "uid for the process"},
72+
cli.StringSliceFlag{Name: "uidmappings", Usage: "add UIDMappings e.g HostID:ContainerID:Size"},
73+
cli.StringFlag{Name: "user", Usage: "user namespace"},
74+
cli.StringFlag{Name: "uts", Usage: "uts namespace"},
7575
}
7676

7777
var generateCommand = cli.Command{

cmd/ocitools/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ func main() {
1313
app.Version = "0.0.1"
1414
app.Usage = "Utilities for OCI"
1515
app.Flags = []cli.Flag{
16+
cli.BoolFlag{
17+
Name: "host-specific",
18+
Usage: "generate host-specific configs or do host-specific validations",
19+
},
1620
cli.StringFlag{
1721
Name: "log-level",
1822
Value: "error",
1923
Usage: "Log level (panic, fatal, error, warn, info, or debug)",
2024
},
21-
cli.BoolFlag{
22-
Name: "host-specific",
23-
Usage: "generate host-specific configs or do host-specific validations",
24-
},
2525
}
2626

2727
app.Commands = []cli.Command{

man/ocitools-generate.1.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,14 @@ read the configuration from `config.json`.
9696
**--linux-cpu-quota**=CPUQUOTA
9797
Specifies the total amount of time in microseconds for which all tasks in a cgroup can run during one period.
9898

99-
**--linux-realtime-runtime**=REALTIMERUNTIME
100-
Specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources.
101-
102-
**--linux-realtime-period**=REALTIMEPERIOD
103-
Sets the CPU period to be used for realtime scheduling (in usecs). Same as **--linux-cpu-period** but applies to realtime scheduler only.
104-
10599
**--linux-cpus**=CPUS
106100
Sets the CPUs to use within the cpuset (default is to use any CPU available).
107101

108-
**--linux-mems**=MEMS
109-
Sets the list of memory nodes in the cpuset (default is to use any available memory node).
102+
**--linux-mem-kernel-limit**=MEMKERNELLIMIT
103+
Sets the hard limit of kernel memory in bytes.
104+
105+
**--linux-mem-kernel-tcp**=MEMKERNELTCP
106+
Sets the hard limit of kernel TCP buffer memory in bytes.
110107

111108
**--linux-mem-limit**=MEMLIMIT
112109
Sets the limit of memory usage in bytes.
@@ -117,15 +114,18 @@ read the configuration from `config.json`.
117114
**--linux-mem-swap**=MEMSWAP
118115
Sets the total memory limit (memory + swap) in bytes.
119116

120-
**--linux-mem-kernel-limit**=MEMKERNELLIMIT
121-
Sets the hard limit of kernel memory in bytes.
122-
123-
**--linux-mem-kernel-tcp**=MEMKERNELTCP
124-
Sets the hard limit of kernel TCP buffer memory in bytes.
125-
126117
**--linux-mem-swappiness**=MEMSWAPPINESS
127118
Sets the swappiness of how the kernel will swap memory pages (Range from 0 to 100).
128119

120+
**--linux-mems**=MEMS
121+
Sets the list of memory nodes in the cpuset (default is to use any available memory node).
122+
123+
**--linux-realtime-period**=REALTIMEPERIOD
124+
Sets the CPU period to be used for realtime scheduling (in usecs). Same as **--linux-cpu-period** but applies to realtime scheduler only.
125+
126+
**--linux-realtime-runtime**=REALTIMERUNTIME
127+
Specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources.
128+
129129
**--mount**=*PATH*
130130
Use a mount namespace where *PATH* is an existing mount namespace file
131131
to join. The special *PATH* empty-string creates a new namespace.
@@ -162,14 +162,14 @@ read the configuration from `config.json`.
162162
**--oom-score-adj**=adj
163163
Specifies oom_score_adj for the container.
164164

165+
**--os**=OS
166+
Operating system used within the container
167+
165168
**--output**=PATH
166169
Instead of writing the configuration JSON to stdout, write it to a
167170
file at *PATH* (overwriting the existing content if a file already
168171
exists at *PATH*).
169172

170-
**--os**=OS
171-
Operating system used within the container
172-
173173
**--pid**=*PATH*
174174
Use a PID namespace where *PATH* is an existing PID namespace file
175175
to join. The special *PATH* empty-string creates a new namespace.
@@ -213,23 +213,23 @@ read the configuration from `config.json`.
213213
Specifies Additional architectures permitted to be used for system calls.
214214
By default if you turn on seccomp, only the host architecture will be allowed.
215215

216+
**--seccomp-allow**=SYSCALL
217+
Specifies syscalls to be added to the ALLOW list.
218+
See --seccomp-syscalls for setting limits on arguments.
219+
216220
**--seccomp-default**=ACTION
217221
Specifies the the default action of Seccomp syscall restrictions
218222
Values: KILL,ERRNO,TRACE,ALLOW
219223

224+
**--seccomp-errno**=SYSCALL
225+
Specifies syscalls to be added to the ERRNO list.
226+
See --seccomp-syscalls for setting limits on arguments.
227+
220228
**--seccomp-syscalls**=SYSCALLS
221229
Specifies Additional syscalls permitted to be used for system calls,
222230
e.g Name:Action:Arg1_index/Arg1_value/Arg1_valuetwo/Arg1_op, Arg2_index/Arg2_value/Arg2_valuetwo/Arg2_op
223231
See --seccomp-allow and --seccomp-errno for convenient way to set seccomp syscall options.
224232

225-
**--seccomp-allow**=SYSCALL
226-
Specifies syscalls to be added to the ALLOW list.
227-
See --seccomp-syscalls for setting limits on arguments.
228-
229-
**--seccomp-errno**=SYSCALL
230-
Specifies syscalls to be added to the ERRNO list.
231-
See --seccomp-syscalls for setting limits on arguments.
232-
233233
**--selinux-label**=PROCESSLABEL
234234
SELinux Label
235235
Depending on your SELinux policy, you would specify a label that looks like

man/ocitools.1.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ ocitools is a collection of tools for working with the [OCI runtime specificatio
1717
**--help**
1818
Print usage statement.
1919

20-
**-v**, **--version**
21-
Print version information.
22-
23-
**--log-level**
24-
Log level (panic, fatal, error, warn, info, or debug) (default: "error").
25-
2620
**--host-specific**
2721
Generate host-specific configs or do host-specific validations.
2822

@@ -35,6 +29,12 @@ ocitools is a collection of tools for working with the [OCI runtime specificatio
3529
With this flag, validation will also run more specific tests to see whether
3630
the current host is capable of launching a container from the configuration.
3731

32+
**--log-level**
33+
Log level (panic, fatal, error, warn, info, or debug) (default: "error").
34+
35+
**-v**, **--version**
36+
Print version information.
37+
3838
# COMMANDS
3939
**validate**
4040
Validating OCI bundle

0 commit comments

Comments
 (0)