Added *routes_maxcost flag. Fixes #2563

This commit is contained in:
Trial97
2021-02-08 17:04:27 +02:00
committed by Dan Christian Bogos
parent 0389c6be11
commit eb743a45cc
14 changed files with 239 additions and 68 deletions

View File

@@ -167,6 +167,16 @@ func (fWp FlagParams) Has(opt string) (has bool) {
return
}
// ParamValue returns the value of the flag
func (fWp FlagParams) ParamValue(opt string) (ps string) {
for _, ps = range fWp[opt] {
if ps != EmptyString {
return
}
}
return
}
// Add adds the options to the flag
func (fWp FlagParams) Add(opts []string) {
switch len(opts) {
@@ -234,6 +244,14 @@ func (fWp FlagsWithParams) ParamsSlice(subs, opt string) (ps []string) {
return
}
// ParamValue returns the value of the flag
func (fWp FlagsWithParams) ParamValue(subs string) (ps string) {
for ps = range fWp[subs] {
return
}
return
}
// SliceFlags converts from FlagsWithParams back to []string
func (fWp FlagsWithParams) SliceFlags() (sls []string) {
for key, sub := range fWp {