Skip to content

Nicer options #18

Open
Open

Description

@jbenet

this sucks

> multihash --help
usage: multihash [options] [FILE]
Print or check multihash checksums.
With no FILE, or when FILE is -, read standard input.

Options:
  -a string
        one of: sha1, sha2-256, sha2-512, sha3 (shorthand) (default "sha2-256")
  -algorithm string
        one of: sha1, sha2-256, sha2-512, sha3 (default "sha2-256")
  -c string
        check checksum matches (shorthand)
  -check string
        check checksum matches
  -e string
        one of: raw, hex, base58, base64 (shorthand) (default "base58")
  -encoding string
        one of: raw, hex, base58, base64 (default "base58")
  -l int
        checksums length in bits (truncate). -1 is default (shorthand) (default -1)
  -length int
        checksums length in bits (truncate). -1 is default (default -1)
  -q    quiet output (no newline on checksum, no error text) (shorthand)
  -quiet
        quiet output (no newline on checksum, no error text)

this would be nicer

> multihash --help
usage: multihash [options] [FILE]
Print or check multihash checksums.
With no FILE, or when FILE is -, read standard input.

Options:
  -a, --algorithm string  one of: sha1, sha2-256, sha2-512, sha3 (default: sha2-256)
  -c, --check string      check checksum matches
  -e, --encoding string   one of: raw, hex, base58, base64 (default: base58)
  -l, --length int        checksum length in bits (truncate). -1 is default (default: -1)
  -q, --quiet             quiet output (no newline on checksum, no error text)

Activity

  1. chriscool commented on Jul 13, 2016

    @chriscool
    Contributor

    I agree. Also -h, --help ... should appear among the displayed options.

  2. chriscool commented on Jul 13, 2016

    @chriscool
    Contributor

    And -algorithm with only one "-" appear to work:

    > multihash -algorithm sha2-512 Makefile 
    8Vus44JWecERsdjdNPPbmo7X7K1EwuMJUfTZRJVRE9kyNeCEzNhUkdCNdQYUHRqT9heADbBx7LfrYgQ13eRwNEwfdu
    

    not sure if is a feature or a bug.

  3. jbenet commented on Jul 30, 2016

    @jbenet
    MemberAuthor

    not sure if is a feature or a bug.

    I think it's because Go treats them the same.

    I'm inclined to think they should be different, but it may be ok to allow both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions