Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs key gen expect mandatorily the optional parameter '-t' #6861

Closed
RubenKelevra opened this issue Feb 2, 2020 · 3 comments · Fixed by #6864
Closed

ipfs key gen expect mandatorily the optional parameter '-t' #6861

RubenKelevra opened this issue Feb 2, 2020 · 3 comments · Fixed by #6864
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@RubenKelevra
Copy link
Contributor

Version information:

go-ipfs version: 0.4.23-6ce9a355f
Repo version: 7
System version: amd64/linux
Golang version: go1.13.7

Description:

The help states, that '-t' is optional:

$ ipfs key gen --help
USAGE
  ipfs key gen <name> - Create a new keypair

SYNOPSIS
  ipfs key gen [--type=<type> | -t] [--size=<size> | -s] [--] <name>

ARGUMENTS

  <name> - name of key to create

OPTIONS

  -t, --type  string - type of the key to create [rsa, ed25519].
  -s, --size  int    - size of the key to generate.

But running key gen without '-t' fails:

$ ipfs key gen "test"
Error: please specify a key type with --type
@RubenKelevra RubenKelevra added the kind/bug A bug in existing code (including security flaws) label Feb 2, 2020
@hsanjuan hsanjuan added exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue labels Feb 3, 2020
Stebalien added a commit that referenced this issue Feb 4, 2020
It's already the default when initializing the node, we might as well make it
the default when creating new keys.

fixes #6861
@Stebalien
Copy link
Member

In general, IPFS doesn't have a way to specify "optional" versus "mandatory" flags. However, it makes sense to just make all flags optional (and that's much easier to fix than adding mandatory flags).

fix in #6864.

@RubenKelevra
Copy link
Contributor Author

In general, IPFS doesn't have a way to specify "optional" versus "mandatory" flags. However, it makes sense to just make all flags optional (and that's much easier to fix than adding mandatory flags).

While the --help output isn't strictly speaking a man page, its output follows the styling of a man page.

The man page for man specifies that

any or all arguments within [ ] are optional.

That was what I was referring to.

fix in #6864.

Thanks for the fast fix!

@Stebalien
Copy link
Member

That was what I was referring to.

Yeah, I know. But that help text is auto-generated and fixing it would require either a hack or adding the concept of "mandatory"/"optional" flags to our commands library (non trivial and really not worth it).

ralendor pushed a commit to ralendor/go-ipfs that referenced this issue Jun 6, 2020
It's already the default when initializing the node, we might as well make it
the default when creating new keys.

fixes ipfs#6861
ralendor pushed a commit to ralendor/go-ipfs that referenced this issue Jun 8, 2020
It's already the default when initializing the node, we might as well make it
the default when creating new keys.

fixes ipfs#6861
ralendor pushed a commit to ralendor/go-ipfs that referenced this issue Jun 8, 2020
It's already the default when initializing the node, we might as well make it
the default when creating new keys.

fixes ipfs#6861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants