Move external borgmatic config commands into borgmatic #529
Reference in New Issue
Block a user
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
borgmaticexecutable instead? That way they'd show in--help, etc.Examples:
generate-borgmatic-config→borgmatic generateupgrade-borgmatic-config→borgmatic upgradevalidate-borgmatic-config→borgmatic validateYes, 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 createborgmatic validate ←→ borgmatic checkIt would be clear from
borgmatic --help, of course. Something like:borgmatic generate-configborgmatic validate-configborgmatic upgrade-configwould 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-generateborgmatic config-validateborgmatic config-upgradeEntering
borgmatic configfollowed byTAB TABwould 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
borguses forkey, etc. Example:borgmatic config generateborgmatic config validateborgmatic config upgradeBash completion would be pretty cool, too!
Ugh, just remembered there's already a
borg configthat 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-configcan becomeborgmatic config generate.validate-borgmatic-configcan 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 configandborgmatic configwould be separated.Oh, hah. Good point. Yeah, I haven't given that much thought recently. Some ideas off the top of my head:
borgmatic configcalls to Borg like a standard borgmatic action, but then hijackborgmatic config generateandborgmatic config validatefor the borgmatic-specific functionality. Potentially a little confusing for the user, but then again probably nobody wants to useborg configanyway.borg config, at least at first. Addborgmatic config validateandborgmatic config generatewith the idea that plainborgmatic configcould 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.configfor 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.