Improve CLI argument parsing #569
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#569
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
What I'm trying to do and why
Accidentally ran
borgmatic create bad-argument
.Actual behavior (if a bug)
Expected behavior (if a bug)
Borgmatic should treat
bad-argument
as a bad argument toborgmatic create
instead of as a bad argument toborgmatic
.borgmatic version: 1.6.6
Thanks for reporting this! However, this behavior is actually by design, in some sense. There are two classes of things given on borgmatic's command-line, flags (e.g.,
--files
) and actions (e.g.,create
). In your example, sincebad-argument
doesn't start with a dash, borgmatic is interpreting it as an action since you can specify multiple actions on the command-line at once. So, for instance,borgmatic create list
is totally valid. And sincebad-argument
isn't valid, borgmatic is helpfully listing out other actions for you to choose from instead.Let me know if that makes sense!
Closing this for now, but feel free to follow up. We can always reopen it. Thanks!