Skip to content

Commit

Permalink
main: Use C99 style initializers
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Sep 26, 2024
1 parent 58a9aa0 commit 2382ad6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 78 deletions.
20 changes: 8 additions & 12 deletions tools/composefs-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,14 @@ int main(int argc, char **argv)
const char *bin = argv[0];
int opt;
const struct option longopts[] = {
{
name: "basedir",
has_arg: required_argument,
flag: NULL,
val: OPT_BASEDIR
},
{
name: "filter",
has_arg: required_argument,
flag: NULL,
val: OPT_FILTER
},
{ .name = "basedir",
.has_arg = required_argument,
.flag = NULL,
.val = OPT_BASEDIR },
{ .name = "filter",
.has_arg = required_argument,
.flag = NULL,
.val = OPT_FILTER },
{},
};

Expand Down
104 changes: 38 additions & 66 deletions tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,72 +1475,44 @@ static void usage(const char *argv0)
int main(int argc, char **argv)
{
const struct option longopts[] = {
{
name: "skip-xattrs",
has_arg: no_argument,
flag: NULL,
val: OPT_SKIP_XATTRS
},
{
name: "user-xattrs",
has_arg: no_argument,
flag: NULL,
val: OPT_USER_XATTRS
},
{
name: "skip-devices",
has_arg: no_argument,
flag: NULL,
val: OPT_SKIP_DEVICES
},
{
name: "use-epoch",
has_arg: no_argument,
flag: NULL,
val: OPT_USE_EPOCH
},
{
name: "digest-store",
has_arg: required_argument,
flag: NULL,
val: OPT_DIGEST_STORE
},
{
name: "print-digest",
has_arg: no_argument,
flag: NULL,
val: OPT_PRINT_DIGEST
},
{
name: "print-digest-only",
has_arg: no_argument,
flag: NULL,
val: OPT_PRINT_DIGEST_ONLY
},
{
name: "from-file",
has_arg: no_argument,
flag: NULL,
val: OPT_FROM_FILE
},
{
name: "max-version",
has_arg: required_argument,
flag: NULL,
val: OPT_MAX_VERSION
},
{
name: "min-version",
has_arg: required_argument,
flag: NULL,
val: OPT_MIN_VERSION
},
{
name: "threads",
has_arg: required_argument,
flag: NULL,
val: OPT_THREADS
},
{ .name = "skip-xattrs",
.has_arg = no_argument,
.flag = NULL,
.val = OPT_SKIP_XATTRS },
{ .name = "user-xattrs",
.has_arg = no_argument,
.flag = NULL,
.val = OPT_USER_XATTRS },
{ .name = "skip-devices",
.has_arg = no_argument,
.flag = NULL,
.val = OPT_SKIP_DEVICES },
{ .name = "use-epoch", .has_arg = no_argument, .flag = NULL, .val = OPT_USE_EPOCH },
{ .name = "digest-store",
.has_arg = required_argument,
.flag = NULL,
.val = OPT_DIGEST_STORE },
{ .name = "print-digest",
.has_arg = no_argument,
.flag = NULL,
.val = OPT_PRINT_DIGEST },
{ .name = "print-digest-only",
.has_arg = no_argument,
.flag = NULL,
.val = OPT_PRINT_DIGEST_ONLY },
{ .name = "from-file", .has_arg = no_argument, .flag = NULL, .val = OPT_FROM_FILE },
{ .name = "max-version",
.has_arg = required_argument,
.flag = NULL,
.val = OPT_MAX_VERSION },
{ .name = "min-version",
.has_arg = required_argument,
.flag = NULL,
.val = OPT_MIN_VERSION },
{ .name = "threads",
.has_arg = required_argument,
.flag = NULL,
.val = OPT_THREADS },
{},
};
struct lcfs_write_options_s options = { 0 };
Expand Down

0 comments on commit 2382ad6

Please sign in to comment.