mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added *routes_maxcost flag. Fixes #2563
This commit is contained in:
committed by
Dan Christian Bogos
parent
0389c6be11
commit
eb743a45cc
18
utils/map.go
18
utils/map.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user