Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app: Rename internals → ex #683

Closed

Conversation

cgwalters
Copy link
Member

The goal is to consolidate our "experimental" functionality under one
subcommand. This makes it easier to determine when things "graduate"
to permanent-stability status under the main command line.

Closes: #682

@cgwalters cgwalters force-pushed the kids-ex-is-for-experimental branch from c6fa945 to c0d7b21 Compare March 16, 2017 13:27
@cgwalters
Copy link
Member Author

Rebased on #684 since we need that to pass the CI now.

(I broke this with http://pkgs.fedoraproject.org/cgit/rpms/ostree.git/commit/?id=ca89bf28a60ad8a618b58ea90c03ba332c175124 which I'd kind of intended only to do in rawhide but ended up everywhere after a git merge)

RpmOstreeCommand *subcommand;
const char *subcommand_name = NULL;
g_autofree char *prgname = NULL;
int exit_status = EXIT_SUCCESS;

subcommand_name = rpmostree_subcommand_parse (&argc, argv);

subcommand = internals_subcommands;
if (!rpmostree_option_context_parse (context, NULL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done inside the if (!subcommand->name) branch below, right? Otherwise, e.g. rpm-ostree ex unpack --help will print the help message for rpm-ostree ex rather than the unpack subcommand. This is done properly I think in the compose built-in. Maybe we can unify subcommand handling as well? (There are some other inconsistencies right now between compose and ex. E.g. rpm-ostree compose vs rpm-ostree ex return different error messages.).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, e.g. rpm-ostree ex unpack --help will print the help message for rpm-ostree ex rather than the unpack subcommand.

Looks like this is also an issue with the container subcommands.

I think this ends up being cleaner - the properties of
a command are now consistently represented as flags.

Prep work for coreos#682
The goal is to consolidate our "experimental" functionality under one
subcommand.  This makes it easier to determine when things "graduate"
to permanent-stability status under the main command line.

Closes: coreos#682
Now all of our "experimental" bits are under one roof, so we get consistent
handling for them.
@cgwalters cgwalters force-pushed the kids-ex-is-for-experimental branch from c0d7b21 to b6dcc09 Compare March 16, 2017 17:29
@cgwalters
Copy link
Member Author

The problem is that we needed to handle the _EXPERIMENTAL flag before running subcommands. I rewoked things so we look at that flag early on in subcommands, separate from the other flags as part of the option processing.

g_assert (invocation);

g_printerr ("%snotice%s: %s is an experimental command and subject to change.\n",
bold_prefix, bold_suffix, invocation->command->name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think invocation->command->name will always be ex here. What we actually want is command_name below, right? Alternatively, the commands under ex also need to be flagged as EXPERIMENTAL but not ex itself? Hmm, kinda messy.

the properties of a command are now consistently represented as flags

That makes sense, though for EXPERIMENTAL, since only ex will use it, it might be cleaner to drop that flag and print the notice in rpmostree_builtin_ex()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess...though I dunno that it's really valuable to polish this extensively - time I spend tweaking the fine details of the code here is time not spent on actually writing livefs or tests etc.

@jlebon
Copy link
Member

jlebon commented Mar 16, 2017

OK, we can polish later.
@rh-atomic-bot r+ b6dcc09

@rh-atomic-bot
Copy link

⌛ Testing commit b6dcc09 with merge 710ea30...

rh-atomic-bot pushed a commit that referenced this pull request Mar 16, 2017
Closes: #683
Approved by: jlebon
rh-atomic-bot pushed a commit that referenced this pull request Mar 16, 2017
I think this ends up being cleaner - the properties of
a command are now consistently represented as flags.

Prep work for #682

Closes: #683
Approved by: jlebon
rh-atomic-bot pushed a commit that referenced this pull request Mar 16, 2017
The goal is to consolidate our "experimental" functionality under one
subcommand.  This makes it easier to determine when things "graduate"
to permanent-stability status under the main command line.

Closes: #682

Closes: #683
Approved by: jlebon
rh-atomic-bot pushed a commit that referenced this pull request Mar 16, 2017
Now all of our "experimental" bits are under one roof, so we get consistent
handling for them.

Closes: #683
Approved by: jlebon
@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing 710ea30 to master...

jlebon added a commit to jlebon/rpm-ostree that referenced this pull request Mar 16, 2017
This is a follow-up to coreos#683. All the experimental commands will be under
`rpm-ostree ex`, so we remove the flag and instead print the notice
before dispatching the subcommand, where we can print the correct name.
@jlebon jlebon mentioned this pull request Mar 16, 2017
rh-atomic-bot pushed a commit that referenced this pull request Mar 16, 2017
This is a follow-up to #683. All the experimental commands will be under
`rpm-ostree ex`, so we remove the flag and instead print the notice
before dispatching the subcommand, where we can print the correct name.

Closes: #688
Approved by: cgwalters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants