list: hint to use repo-list when no archive NAME is given Refs #9545 by charmikadi · Pull Request #9571 · borgbackup/borg · GitHub
Skip to content

list: hint to use repo-list when no archive NAME is given Refs #9545 - #9571

Open
charmikadi wants to merge 6 commits into
borgbackup:masterfrom
charmikadi:fix/list-missing-name-hint
Open

charmikadi wants to merge 6 commits into
borgbackup:masterfrom
charmikadi:fix/list-missing-name-hint

Conversation

@charmikadi

@charmikadi charmikadi commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

When a user runs borg list without an archive NAME, they get a generic argparse error. This is confusing for users migrating from borg1 who expect borg list to list archives (which is now borg repo-list in borg2).

This makes the name argument optional at the parser level and adds a clear error message in do_list suggesting the correct command:

Error: borg list requires an archive NAME.
To list the archives in a repository, use: borg repo-list

Fixes #9545

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests and docs where appropriate
  • Commit messages are clean and reference related issues

@codecov

codecov Bot commented Apr 14, 2026 •

Copy link
Copy Markdown

Add test for list command without archive name
Updated error handling in the do_list method to print error message to stderr.
Replace return code with set_ec for error handling.
@charmikadi

Copy link
Copy Markdown
Contributor Author

This branch has not been deployed

No deployments
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.

Add targeted “Common fixes” hints for specific mistaken borg command lines

1 participant