Move external borgmatic config commands into borgmatic #529
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi, it would be great if all borgmatic related commands could start with "borgmatic":
generate-borgmatic-config → borgmatic-generate-config
upgrade-borgmatic-config → borgmatic-upgrade-config
validate-borgmatic-config → borgmatic-validate-config
This would simplify finding them using shell-completion when you don't remember them exactly without looking up the documentation. Of course a minor wishlist suggestion.
Best Regards, Andi
Thanks for this suggestion! I like the idea of improved discoverability. What do you think about integrating these commands into the main
borgmatic
executable instead? That way they'd show in--help
, etc.Examples:
generate-borgmatic-config
→borgmatic generate
upgrade-borgmatic-config
→borgmatic upgrade
validate-borgmatic-config
→borgmatic validate
Yes, probably slightly more work, but even better, I guess. The only issue I see from an end-user perspective is the confusion related to something like:
borgmatic generate ←→ borgmatic create
borgmatic validate ←→ borgmatic check
It would be clear from
borgmatic --help
, of course. Something like:borgmatic generate-config
borgmatic validate-config
borgmatic upgrade-config
would make the relation to the configuration obvious, but that's perhaps a matter of taste. Thank you for borgmatic!
Hm, thinking about bash completion, perhaps the following would be possible, when
config-
comes first:borgmatic config-generate
borgmatic config-validate
borgmatic config-upgrade
Entering
borgmatic config
followed byTAB TAB
would then show me the valid commandsconfig-generate config-validate config-upgrade
, when provided with a proper bash-completion configuration …That makes sense to me. Could even be a sub-action like
borg
uses forkey
, etc. Example:borgmatic config generate
borgmatic config validate
borgmatic config upgrade
Bash completion would be pretty cool, too!
Ugh, just remembered there's already a
borg config
that this would collide with. (Unless they could be made to coexist.)This ticket isn't started yet, but I wanted to mention that borgmatic bash completion is now implemented in master! Thanks for the suggestion.
My current thinking on this ticket:
upgrade-borgmatic-config
(and the corresponding code/tests) can just be outright deleted. borgmatic hasn't had INI-style config since 1.1.0. If keeping the docs for this, they should be updated to mention using the last version of borgmatic to includeupgrade-borgmatic-config
.generate-borgmatic-config
can becomeborgmatic config generate
.validate-borgmatic-config
can becomeborgmatic config validate
.So did you make a design decision regarding this - #529 (comment) ?
I think that quoted text is the design decision. Were you looking for something more specific? Or just a more definitive ruling? 😄
No, I meant how
borg config
andborgmatic config
would be separated.Oh, hah. Good point. Yeah, I haven't given that much thought recently. Some ideas off the top of my head:
borgmatic config
calls to Borg like a standard borgmatic action, but then hijackborgmatic config generate
andborgmatic config validate
for the borgmatic-specific functionality. Potentially a little confusing for the user, but then again probably nobody wants to useborg config
anyway.borg config
, at least at first. Addborgmatic config validate
andborgmatic config generate
with the idea that plainborgmatic config
could be added later if/when someone wants it. That's basically the same design as the first bullet point, just with less work up-front.config
for the borgmatic functionality in this ticket. Nothing decent comes to mind though.Implemented in main. FYI I went this approach for now:
Rename commands to start with borgmatic-to Move external borgmatic config commands into borgmaticJust released in borgmatic 1.7.15.