This parameter can be used multiple times.
.TP
-.B -r <name>
+.B -r, --variable <name>
defines parameter to display.
This option can be used multiple times.
This option can be used multiple times.
.TP
-.B -a
+.B -a, --all
print the variables for all controllers which consists given cgroup
.TP
do not print headers, i.e. name of groups.
.TP
-.B -v
+.B -v, --values-only
print only values, not parameter names.
+.TP
+.B -h, --help
+display help and exit
+
.SH EXAMPLES
.nf
$ cgget -r cpuset.cpus -r cpuset.mems first second
#define LL_MAX 100
+static struct option const long_options[] =
+{
+ {"variable", required_argument, NULL, 'r'},
+ {"help", no_argument, NULL, 'h'},
+ {"all", no_argument, NULL, 'a'},
+ {"values-only", no_argument, NULL, 'v'},
+ {NULL, 0, NULL, 0}
+};
+
+
static void usage(int status, const char *program_name)
{
if (status != 0)
" try %s -h' for more information.\n",
program_name);
else {
- printf("Usage: %s [-nv] [-r<name>] [-g<controller>] [-a] ..."\
+ printf("Usage: %s [-nv] [-r<name>] [-g<controller>] [-a] ... "\
"<path> ...\n", program_name);
}
}
}
/* Parse arguments. */
- while ((c = getopt(argc, argv, "r:hnvg:a")) != -1) {
+ while ((c = getopt_long(argc, argv, "r:hnvg:a", long_options, NULL))
+ > 0) {
switch (c) {
case 'h':
usage(0, argv[0]);