added plugin detected
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"git.sr.ht/~akilan1999/p2p-rendering-computation/client"
|
||||
"git.sr.ht/~akilan1999/p2p-rendering-computation/config"
|
||||
"git.sr.ht/~akilan1999/p2p-rendering-computation/p2p"
|
||||
"git.sr.ht/~akilan1999/p2p-rendering-computation/plugin"
|
||||
"git.sr.ht/~akilan1999/p2p-rendering-computation/server"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
@@ -124,6 +125,16 @@ var CliAction = func(ctx *cli.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// If the view plugin flag is called then display all
|
||||
// plugins available
|
||||
if ViewPlugin {
|
||||
plugins ,err := plugin.DetectPlugins()
|
||||
if err != nil {
|
||||
fmt.Print(err)
|
||||
}
|
||||
client.PrettyPrint(plugins)
|
||||
}
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ var (
|
||||
ServerList bool
|
||||
SetDefaultConfig bool
|
||||
NetworkInterface bool
|
||||
ViewPlugin bool
|
||||
)
|
||||
|
||||
var AppConfigFlags = []cli.Flag{
|
||||
@@ -122,4 +123,11 @@ var AppConfigFlags = []cli.Flag{
|
||||
EnvVars: []string{"NETWORK_INTERFACE"},
|
||||
Destination: &NetworkInterface,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "ViewPlugins",
|
||||
Aliases: []string{"vp"},
|
||||
Usage: "Shows plugins available to be executed",
|
||||
EnvVars: []string{"VIEW_PLUGIN"},
|
||||
Destination: &ViewPlugin,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user