Add 'dis' component
This commit adds a new 'dis' component to the distillery that serves a list of all known instances for the moment.
This commit is contained in:
parent
35bb95c5ca
commit
4b357476a3
43 changed files with 434 additions and 167 deletions
26
core/requirements.go
Normal file
26
core/requirements.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/tkw1536/goprogram"
|
||||
"github.com/tkw1536/goprogram/meta"
|
||||
)
|
||||
|
||||
// Requirements are requirements for the WissKI Distillery
|
||||
type Requirements struct {
|
||||
// Do we need an installed distillery?
|
||||
NeedsDistillery bool
|
||||
}
|
||||
|
||||
// AllowsFlag checks if the provided flag may be passed to fullfill this requirement
|
||||
// By default it is used only for help page generation, and may be inaccurate.
|
||||
func (r Requirements) AllowsFlag(flag meta.Flag) bool {
|
||||
return r.NeedsDistillery
|
||||
}
|
||||
|
||||
// Validate validates if this requirement is fullfilled for the provided global flags.
|
||||
// It should return either nil, or an error of type exit.Error.
|
||||
//
|
||||
// Validate does not take into account AllowsOption, see ValidateAllowedOptions.
|
||||
func (r Requirements) Validate(arguments goprogram.Arguments[Flags]) error {
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue