Comments (3)
There is a backport of the arg parse that's supposed to work on 2.6. Maybe that's the way to clean up the arg parsing.
from b2_command_line_tool.
I tried setting up argparse for two of the b2 commands, and I'm not very happy with the help text that argparse provides:
$ b2 -h create_bucket
usage: b2 [-h] {create_bucket,authorize_account} ...
Command-line tool that provides access to the Backblaze B2 service.
positional arguments:
{create_bucket,authorize_account}
create_bucket Creates a new bucket. Prints the ID of the bucket
created.
authorize_account Prompts for Backblaze accountID and applicationKey
(unless they are given on the command line). The
account ID is a 12-digit hex number that you can get
from your account page on backblaze.com. The
application key is a 40-digit hex number that you can
get from your account page on backblaze.com. Stores an
account auth token in ~/.b2_account_info
optional arguments:
-h, --help show this help message and exit
$ b2 create_bucket -h
usage: b2 create_bucket [-h] bucketName {allPrivate,allPublic}
positional arguments:
bucketName
{allPrivate,allPublic}
optional arguments:
-h, --help show this help message and exit
What I'd rather see is a summarized list of commands and arguments, with details when you pick one:
$ b2
Usage: b2 <command> <options>
b2 authorize_account [accountId] [applicationKey]
b2 create_bucket [bucketName] [bucketType]
$ b2 create_bucket
Usage: b2 create_bucket [bucketName] [bucketType]
Creates a new bucket. The name must be ..., and the bucket
type should be either allPublic or allPrivate.
from b2_command_line_tool.
I just push up a branch called "args" with an alternate approach that prints usage messages I like.
from b2_command_line_tool.
Related Issues (20)
- Install from source documentation section should be updated to PDM
- B2_DEBUG_HTTP=1 does not seem to have any effect HOT 1
- Feature request: use b2 cli without saving plaintext credentials in `.b2_account_info` HOT 9
- Official Docker Image ? HOT 3
- delete_file_version needs bypassGovernance option HOT 1
- Can't upload FIFOs with upload-file HOT 6
- UnicodeEncodeError: 'ascii' codec can't encode character '\u2022' in position 1325: ordinal not in range(128) HOT 1
- [Question] Explain how sync between buckets work; slow overall speed HOT 8
- b2sdk.exception.InvalidAuthToken: Invalid authorization token. Server said: (bad_auth_token) HOT 2
- Error when resuming upload HOT 2
- switch to stable pypy version after new pypy is released HOT 2
- b2 ls --json destroys output structure with informational message HOT 1
- `Using https://api.backblazeb2.com` output to stderr causing problems for automation that only expects errors and warnings on stderr
- pip install breaks with setuptools 69.0.0 HOT 3
- b2 should respect the spec's default fallback for `XDG_CONFIG_HOME` HOT 4
- Feature request: Support transparent compression HOT 1
- error: the following arguments are required: command HOT 5
- Issue with b2 sync :: KeyError: 'content-length' HOT 11
- Package `b2` for Alpine Linux HOT 5
- Linux.Xor.DDoS false-positive from chkrootkit due PyInstaller use
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from b2_command_line_tool.