Implement unit property for flags

This commit is contained in:
nemunaire 2021-11-12 23:52:22 +01:00
commit 61fccca070
7 changed files with 17 additions and 7 deletions

View file

@ -46,6 +46,7 @@ type ExerciceFlag struct {
LockedFile []ExerciceUnlockFile `toml:"unlock_file,omitempty"`
NeedFlag []ExerciceDependency `toml:"need_flag,omitempty"`
NoShuffle bool
Unit string `toml:"unit,omitempty"`
NumberMin interface{} `toml:"min,omitempty"`
NumberMax interface{} `toml:"max,omitempty"`
NumberStep interface{} `toml:"step,omitempty"`

View file

@ -136,6 +136,7 @@ func buildKeyFlag(exercice fic.Exercice, flag ExerciceFlag, flagline int, defaul
Label: flag.Label,
Placeholder: flag.Placeholder,
Help: flag.Help,
Unit: flag.Unit,
IgnoreCase: !flag.CaseSensitive,
Multiline: flag.Type == "text",
ValidatorRegexp: validatorRegexp(flag.ValidatorRe),