GithubHelp home page GithubHelp logo

Comments (3)

bwbeach avatar bwbeach commented on June 16, 2024

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.

bwbeach avatar bwbeach commented on June 16, 2024

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.

bwbeach avatar bwbeach commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.