Skip to content

Commit

Permalink
couper help error (#678)
Browse files Browse the repository at this point in the history
* help command does not expect args

* changelog entry

---------

Co-authored-by: Marcel Ludwig <1841067+malud@users.noreply.github.com>
  • Loading branch information
johakoch and malud authored Jan 30, 2023
1 parent 2e97a6e commit 54dd458
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Unreleased changes are available as `avenga/couper:edge` container.
* **Fixed**
* Use of [backend-related variables](https://docs.couper.io/configuration/variables#backend) in [`custom_log_fields`](https://docs.couper.io/observation/logging#custom-logging) within a [`backend` block](https://docs.couper.io/configuration/block/backend) ([#658](https://github.com/avenga/couper/pull/658))
* Loop with evaluation error in [`custom_log_fields`](https://docs.couper.io/observation/logging#custom-logging) if log level is `"debug"` ([#659](https://github.com/avenga/couper/pull/659))
* Removed error message with `couper help` [command](https://docs.couper.io/configuration/command-line) ([#678](https://github.com/avenga/couper/pull/678))

---

Expand Down
11 changes: 1 addition & 10 deletions command/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package command

import (
"context"
"fmt"

"github.com/avenga/couper/config"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -40,15 +39,7 @@ func NewHelp(ctx context.Context) *Help {

func (h Help) Execute(args Args, _ *config.Couper, _ *logrus.Entry) error {
defer Synopsis()
if len(args) == 0 {
h.Usage()
return fmt.Errorf("missing command argument")
}
cmd := NewCommand(h.ctx, args[0])
if cmd == nil {
return fmt.Errorf("unknown command: %s", args[0])
}
cmd.Usage()
h.Usage()
return nil
}

Expand Down

0 comments on commit 54dd458

Please sign in to comment.