Backblaze / B2_Command_Line_Tool

The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage
Other
529 stars 120 forks source link

Don't show full binary path in help message #993

Closed dawidd6 closed 4 months ago

dawidd6 commented 5 months ago

Without this change:

root@dc7d16c9b121:/usr/local/lib/python3.11/site-packages/b2# b2 --help
/usr/local/bin/b2 [-h] [--help-all]

With this change:

root@dc7d16c9b121:/usr/local/lib/python3.11/site-packages/b2# b2 --help
b2 [-h] [--help-all]
mjurbanski-reef commented 5 months ago

This is a much-needed fix, but I'm afraid the current form is not going to cut it.

We recently introduced what we call apiver aliases, i.e. b2v3 for b2 v3 stable API (no matter which version of b2 binary you installed), and _b2v4 for yet unreleased v4 (after v4 release it will become another b2v4 to be used in scripts etc.

Cases that should be considered: 1) when calling by b2 we expect b2 to be shown in --help text 2) when calling by b2v3 name we expect b2v3 to be shown in --help text 3) ideally if someone renamed binary or aliased their binary we would expect the name used to call it to show up in --help, but this maybe problematic to achieve in practice. While not recommended, someone could run this as python script i.e. python .../b2.py and in that case we wouldn't like to mistakenly show python as "b2" exec in --help (this bug is present right now).

1 and 2 cases should be already tested and if aren't, then we need to add tests covering them.

ppolewicz commented 5 months ago

@dawidd6 would you like to do the extra changes or have someone take over?

dawidd6 commented 5 months ago

Someone can take this over. Tbh I don't understand what needs to be done in this PR.

mjurbanski-reef commented 4 months ago

resolved in #1002

Thank you for brining our attention to this issue.