Skip to content

Commit 6ea3464

Browse files
author
Ma Shimiao
committed
sort options list by letter
Signed-off-by: Ma Shimiao <[email protected]>
1 parent 667045d commit 6ea3464

File tree

4 files changed

+80
-80
lines changed

4 files changed

+80
-80
lines changed

cmd/oci-runtime-tool/generate.go

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,67 +13,67 @@ 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.BoolFlag{Name: "disable-oom-kill", Usage: "disable OOM Killer"},
26+
cli.StringSliceFlag{Name: "env", Usage: "add environment variable e.g. key=value"},
27+
cli.IntFlag{Name: "gid", Usage: "gid for the process"},
5128
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"},
29+
cli.StringSliceFlag{Name: "groups", Usage: "supplementary groups for the process"},
30+
cli.StringFlag{Name: "hostname", Usage: "hostname value for the container"},
31+
cli.StringFlag{Name: "ipc", Usage: "ipc namespace"},
6032
cli.StringSliceFlag{Name: "label", Usage: "add annotations to the configuration e.g. key=value"},
61-
cli.BoolFlag{Name: "disable-oom-kill", Usage: "disable OOM Killer"},
62-
cli.IntFlag{Name: "oom-score-adj", Usage: "oom_score_adj for the container"},
6333
cli.Uint64Flag{Name: "linux-cpu-shares", Usage: "the relative share of CPU time available to the tasks in a cgroup"},
6434
cli.Uint64Flag{Name: "linux-cpu-period", Usage: "the CPU period to be used for hardcapping (in usecs)"},
6535
cli.Uint64Flag{Name: "linux-cpu-quota", Usage: "the allowed CPU time in a given period (in usecs)"},
66-
cli.Uint64Flag{Name: "linux-realtime-runtime", Usage: "the time realtime scheduling may use (in usecs)"},
67-
cli.Uint64Flag{Name: "linux-realtime-period", Usage: "CPU period to be used for realtime scheduling (in usecs)"},
6836
cli.StringFlag{Name: "linux-cpus", Usage: "CPUs to use within the cpuset (default is to use any CPU available)"},
69-
cli.StringFlag{Name: "linux-mems", Usage: "list of memory nodes in the cpuset (default is to use any available memory node)"},
37+
cli.Uint64Flag{Name: "linux-mem-kernel-limit", Usage: "kernel memory limit (in bytes)"},
38+
cli.Uint64Flag{Name: "linux-mem-kernel-tcp", Usage: "kernel memory limit for tcp (in bytes)"},
7039
cli.Uint64Flag{Name: "linux-mem-limit", Usage: "memory limit (in bytes)"},
7140
cli.Uint64Flag{Name: "linux-mem-reservation", Usage: "memory reservation or soft limit (in bytes)"},
7241
cli.Uint64Flag{Name: "linux-mem-swap", Usage: "total memory limit (memory + swap) (in bytes)"},
73-
cli.Uint64Flag{Name: "linux-mem-kernel-limit", Usage: "kernel memory limit (in bytes)"},
74-
cli.Uint64Flag{Name: "linux-mem-kernel-tcp", Usage: "kernel memory limit for tcp (in bytes)"},
7542
cli.Uint64Flag{Name: "linux-mem-swappiness", Usage: "how aggressive the kernel will swap memory pages (Range from 0 to 100)"},
43+
cli.StringFlag{Name: "linux-mems", Usage: "list of memory nodes in the cpuset (default is to use any available memory node)"},
7644
cli.Int64Flag{Name: "linux-pids-limit", Usage: "maximum number of PIDs"},
45+
cli.Uint64Flag{Name: "linux-realtime-period", Usage: "CPU period to be used for realtime scheduling (in usecs)"},
46+
cli.Uint64Flag{Name: "linux-realtime-runtime", Usage: "the time realtime scheduling may use (in usecs)"},
47+
cli.StringFlag{Name: "mount", Usage: "mount namespace"},
48+
cli.StringFlag{Name: "mount-cgroups", Value: "no", Usage: "mount cgroups (rw,ro,no)"},
49+
cli.StringFlag{Name: "mount-label", Usage: "selinux mount context label"},
50+
cli.StringFlag{Name: "network", Usage: "network namespace"},
51+
cli.BoolFlag{Name: "no-new-privileges", Usage: "set no new privileges bit for the container process"},
52+
cli.IntFlag{Name: "oom-score-adj", Usage: "oom_score_adj for the container"},
53+
cli.StringFlag{Name: "os", Value: runtime.GOOS, Usage: "operating system the container is created for"},
54+
cli.StringFlag{Name: "output", Usage: "output file (defaults to stdout)"},
55+
cli.StringFlag{Name: "pid", Usage: "pid namespace"},
56+
cli.StringSliceFlag{Name: "poststart", Usage: "path to poststart hooks"},
57+
cli.StringSliceFlag{Name: "poststop", Usage: "path to poststop hooks"},
58+
cli.StringSliceFlag{Name: "prestart", Usage: "path to prestart hooks"},
59+
cli.BoolFlag{Name: "privileged", Usage: "enable privileged container settings"},
60+
cli.BoolFlag{Name: "read-only", Usage: "make the container's rootfs read-only"},
61+
cli.StringFlag{Name: "root-propagation", Usage: "mount propagation for root"},
62+
cli.StringFlag{Name: "rootfs", Value: "rootfs", Usage: "path to the rootfs"},
63+
cli.StringSliceFlag{Name: "seccomp-arch", Usage: "specifies Additional architectures permitted to be used for system calls"},
64+
cli.StringSliceFlag{Name: "seccomp-allow", Usage: "specifies syscalls to be added to allowed"},
65+
cli.StringFlag{Name: "seccomp-default", Usage: "specifies the the defaultaction of Seccomp syscall restrictions"},
66+
cli.StringSliceFlag{Name: "seccomp-errno", Usage: "specifies syscalls to be added to list that returns an error"},
67+
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 "},
68+
cli.StringFlag{Name: "selinux-label", Usage: "process selinux label"},
69+
cli.StringSliceFlag{Name: "sysctl", Usage: "add sysctl settings e.g net.ipv4.forward=1"},
70+
cli.StringFlag{Name: "template", Usage: "base template to use for creating the configuration"},
71+
cli.StringSliceFlag{Name: "tmpfs", Usage: "mount tmpfs"},
72+
cli.BoolFlag{Name: "tty", Usage: "allocate a new tty for the container process"},
73+
cli.IntFlag{Name: "uid", Usage: "uid for the process"},
74+
cli.StringSliceFlag{Name: "uidmappings", Usage: "add UIDMappings e.g HostID:ContainerID:Size"},
75+
cli.StringFlag{Name: "user", Usage: "user namespace"},
76+
cli.StringFlag{Name: "uts", Usage: "uts namespace"},
7777
}
7878

7979
var generateCommand = cli.Command{

cmd/oci-runtime-tool/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 = "OCI (Open Container Initiative) runtime tools"
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/oci-runtime-tool-generate.1.md

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

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

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

114111
**--linux-mem-limit**=MEMLIMIT
115112
Sets the limit of memory usage in bytes.
@@ -120,18 +117,21 @@ read the configuration from `config.json`.
120117
**--linux-mem-swap**=MEMSWAP
121118
Sets the total memory limit (memory + swap) in bytes.
122119

123-
**--linux-mem-kernel-limit**=MEMKERNELLIMIT
124-
Sets the hard limit of kernel memory in bytes.
125-
126-
**--linux-mem-kernel-tcp**=MEMKERNELTCP
127-
Sets the hard limit of kernel TCP buffer memory in bytes.
128-
129120
**--linux-mem-swappiness**=MEMSWAPPINESS
130121
Sets the swappiness of how the kernel will swap memory pages (Range from 0 to 100).
131122

123+
**--linux-mems**=MEMS
124+
Sets the list of memory nodes in the cpuset (default is to use any available memory node).
125+
132126
**--linux-pids-limit**=PIDSLIMIT
133127
Set maximum number of PIDs.
134128

129+
**--linux-realtime-period**=REALTIMEPERIOD
130+
Sets the CPU period to be used for realtime scheduling (in usecs). Same as **--linux-cpu-period** but applies to realtime scheduler only.
131+
132+
**--linux-realtime-runtime**=REALTIMERUNTIME
133+
Specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources.
134+
135135
**--mount**=*PATH*
136136
Use a mount namespace where *PATH* is an existing mount namespace file
137137
to join. The special *PATH* empty-string creates a new namespace.
@@ -168,14 +168,14 @@ read the configuration from `config.json`.
168168
**--oom-score-adj**=adj
169169
Specifies oom_score_adj for the container.
170170

171+
**--os**=OS
172+
Operating system used within the container
173+
171174
**--output**=PATH
172175
Instead of writing the configuration JSON to stdout, write it to a
173176
file at *PATH* (overwriting the existing content if a file already
174177
exists at *PATH*).
175178

176-
**--os**=OS
177-
Operating system used within the container
178-
179179
**--pid**=*PATH*
180180
Use a PID namespace where *PATH* is an existing PID namespace file
181181
to join. The special *PATH* empty-string creates a new namespace.
@@ -219,23 +219,23 @@ read the configuration from `config.json`.
219219
Specifies Additional architectures permitted to be used for system calls.
220220
By default if you turn on seccomp, only the host architecture will be allowed.
221221

222+
**--seccomp-allow**=SYSCALL
223+
Specifies syscalls to be added to the ALLOW list.
224+
See --seccomp-syscalls for setting limits on arguments.
225+
222226
**--seccomp-default**=ACTION
223227
Specifies the the default action of Seccomp syscall restrictions
224228
Values: KILL,ERRNO,TRACE,ALLOW
225229

230+
**--seccomp-errno**=SYSCALL
231+
Specifies syscalls to be added to the ERRNO list.
232+
See --seccomp-syscalls for setting limits on arguments.
233+
226234
**--seccomp-syscalls**=SYSCALLS
227235
Specifies Additional syscalls permitted to be used for system calls,
228236
e.g Name:Action:Arg1_index/Arg1_value/Arg1_valuetwo/Arg1_op, Arg2_index/Arg2_value/Arg2_valuetwo/Arg2_op
229237
See --seccomp-allow and --seccomp-errno for convenient way to set seccomp syscall options.
230238

231-
**--seccomp-allow**=SYSCALL
232-
Specifies syscalls to be added to the ALLOW list.
233-
See --seccomp-syscalls for setting limits on arguments.
234-
235-
**--seccomp-errno**=SYSCALL
236-
Specifies syscalls to be added to the ERRNO list.
237-
See --seccomp-syscalls for setting limits on arguments.
238-
239239
**--selinux-label**=PROCESSLABEL
240240
SELinux Label
241241
Depending on your SELinux policy, you would specify a label that looks like

man/oci-runtime-tool.1.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ oci-runtime-tool is a collection of tools for working with the [OCI runtime spec
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 @@ oci-runtime-tool is a collection of tools for working with the [OCI runtime spec
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)