Skip to content

Commit

Permalink
Minor updates related to documentation for commands and more osnadmin…
Browse files Browse the repository at this point in the history
… updates (release-2.3) (hyperledger#2322)

* Avoid os.Exit behavior when an osnadmin test fails

This change returns an error from `executeForArgs` when the command line
cannot be parsed. Without this change, tests that use the function
quietly exit without a clear indication as to why.

Signed-off-by: Matthew Sykes <[email protected]>

* generateHelpDocs filters trailing space from text

- Change the generateHelpDocs script to remove trailing spaces from the
  generated help text. This prevents linting failures from
  check_trailingspaces.sh
- Remove trailing space from osnadmin_channel_postscript.md
- Regenerate the help docs with `make help-docs`

Signed-off-by: Matthew Sykes <[email protected]>

* Fix channelID flag reference in osnadmin help

Signed-off-by: Matthew Sykes <[email protected]>
  • Loading branch information
sykesm authored and joshua-roberts committed Nov 4, 2022
1 parent b654f9c commit 6de7461
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/osnadmin/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,18 @@ var _ = Describe("osnadmin", func() {
})
})

Context("when an unknown flag is used", func() {
It("returns an error for long flags", func() {
_, _, err := executeForArgs([]string{"channel", "list", "--bad-flag"})
Expect(err).To(MatchError("unknown long flag '--bad-flag'"))
})

It("returns an error for short flags", func() {
_, _, err := executeForArgs([]string{"channel", "list", "-z"})
Expect(err).To(MatchError("unknown short flag '-z'"))
})
})

Context("when the ca cert cannot be read", func() {
BeforeEach(func() {
ordererCACert = "not-the-ca-cert-youre-looking-for"
Expand Down

0 comments on commit 6de7461

Please sign in to comment.