Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Add command riff doctor
Browse files Browse the repository at this point in the history
  • Loading branch information
zhitongLIU committed Jun 16, 2019
1 parent e71ab46 commit fbe8ef6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/riff.md
Expand Up @@ -20,6 +20,7 @@ riff is for functions
* [riff application](riff_application.md) - applications built from source using application buildpacks
* [riff completion](riff_completion.md) - generate shell completion script
* [riff credential](riff_credential.md) - credentials for container registries
* [riff doctor](riff_doctor.md) - check riff's requirements are installed
* [riff function](riff_function.md) - functions built from source using function buildpacks
* [riff handler](riff_handler.md) - handlers map HTTP requests to applications, functions or images
* [riff processor](riff_processor.md) - processors apply functions to messages on streams
Expand Down
36 changes: 36 additions & 0 deletions docs/riff_doctor.md
@@ -0,0 +1,36 @@
## riff doctor

check riff's requirements are installed

### Synopsis

<todo>

```
riff doctor [flags]
```

### Examples

```
riff doctor
```

### Options

```
-h, --help help for doctor
```

### Options inherited from parent commands

```
--config file config file (default is $HOME/.riff.yaml)
--kube-config file kubectl config file (default is $HOME/.kube/config)
--no-color disable color output in terminals
```

### SEE ALSO

* [riff](riff.md) - riff is for functions

1 change: 1 addition & 0 deletions pkg/riff/commands/riff.go
Expand Up @@ -39,6 +39,7 @@ func NewRiffCommand(c *cli.Config) *cobra.Command {
cmd.AddCommand(NewHandlerCommand(c))
cmd.AddCommand(NewStreamCommand(c))
cmd.AddCommand(NewProcessorCommand(c))
cmd.AddCommand(NewDoctorCommand(c))

return cmd
}
12 changes: 12 additions & 0 deletions pkg/riff/commands/riff_test.go
Expand Up @@ -17,6 +17,7 @@
package commands_test

import (
"github.com/projectriff/riff/pkg/cli"
"testing"

"github.com/projectriff/riff/pkg/riff/commands"
Expand All @@ -33,3 +34,14 @@ func TestRiffCommand(t *testing.T) {

table.Run(t, commands.NewRiffCommand)
}

func TestRiffMainSubCommands(t *testing.T) {
riffCommand := commands.NewRiffCommand(cli.NewDefaultConfig())
commands := riffCommand.Commands()

expectedCount := 7
count := len(commands)
if count != expectedCount {
t.Fatalf("Expected %d riff subcommands, got %d", expectedCount, count)
}
}

0 comments on commit fbe8ef6

Please sign in to comment.