| 1 | // Code generated by 'yaegi extract flag'. DO NOT EDIT. |
| 2 | |
| 3 | //go:build go1.22 |
| 4 | // +build go1.22 |
| 5 | |
| 6 | package stdlib |
| 7 | |
| 8 | import ( |
| 9 | "flag" |
| 10 | "reflect" |
| 11 | ) |
| 12 | |
| 13 | func init() { |
| 14 | Symbols["flag/flag"] = map[string]reflect.Value{ |
| 15 | // function, constant and variable definitions |
| 16 | "Arg": reflect.ValueOf(flag.Arg), |
| 17 | "Args": reflect.ValueOf(flag.Args), |
| 18 | "Bool": reflect.ValueOf(flag.Bool), |
| 19 | "BoolFunc": reflect.ValueOf(flag.BoolFunc), |
| 20 | "BoolVar": reflect.ValueOf(flag.BoolVar), |
| 21 | "CommandLine": reflect.ValueOf(&flag.CommandLine).Elem(), |
| 22 | "ContinueOnError": reflect.ValueOf(flag.ContinueOnError), |
| 23 | "Duration": reflect.ValueOf(flag.Duration), |
| 24 | "DurationVar": reflect.ValueOf(flag.DurationVar), |
| 25 | "ErrHelp": reflect.ValueOf(&flag.ErrHelp).Elem(), |
| 26 | "ExitOnError": reflect.ValueOf(flag.ExitOnError), |
| 27 | "Float64": reflect.ValueOf(flag.Float64), |
| 28 | "Float64Var": reflect.ValueOf(flag.Float64Var), |
| 29 | "Func": reflect.ValueOf(flag.Func), |
| 30 | "Int": reflect.ValueOf(flag.Int), |
| 31 | "Int64": reflect.ValueOf(flag.Int64), |
| 32 | "Int64Var": reflect.ValueOf(flag.Int64Var), |
| 33 | "IntVar": reflect.ValueOf(flag.IntVar), |
| 34 | "Lookup": reflect.ValueOf(flag.Lookup), |
| 35 | "NArg": reflect.ValueOf(flag.NArg), |
| 36 | "NFlag": reflect.ValueOf(flag.NFlag), |
| 37 | "NewFlagSet": reflect.ValueOf(flag.NewFlagSet), |
| 38 | "PanicOnError": reflect.ValueOf(flag.PanicOnError), |
| 39 | "Parse": reflect.ValueOf(flag.Parse), |
| 40 | "Parsed": reflect.ValueOf(flag.Parsed), |
| 41 | "PrintDefaults": reflect.ValueOf(flag.PrintDefaults), |
| 42 | "Set": reflect.ValueOf(flag.Set), |
| 43 | "String": reflect.ValueOf(flag.String), |
| 44 | "StringVar": reflect.ValueOf(flag.StringVar), |
| 45 | "TextVar": reflect.ValueOf(flag.TextVar), |
| 46 | "Uint": reflect.ValueOf(flag.Uint), |
| 47 | "Uint64": reflect.ValueOf(flag.Uint64), |
| 48 | "Uint64Var": reflect.ValueOf(flag.Uint64Var), |
| 49 | "UintVar": reflect.ValueOf(flag.UintVar), |
| 50 | "UnquoteUsage": reflect.ValueOf(flag.UnquoteUsage), |
| 51 | "Usage": reflect.ValueOf(&flag.Usage).Elem(), |
| 52 | "Var": reflect.ValueOf(flag.Var), |
| 53 | "Visit": reflect.ValueOf(flag.Visit), |
| 54 | "VisitAll": reflect.ValueOf(flag.VisitAll), |
| 55 | |
| 56 | // type definitions |
| 57 | "ErrorHandling": reflect.ValueOf((*flag.ErrorHandling)(nil)), |
| 58 | "Flag": reflect.ValueOf((*flag.Flag)(nil)), |
| 59 | "FlagSet": reflect.ValueOf((*flag.FlagSet)(nil)), |
| 60 | "Getter": reflect.ValueOf((*flag.Getter)(nil)), |
| 61 | "Value": reflect.ValueOf((*flag.Value)(nil)), |
| 62 | |
| 63 | // interface wrapper definitions |
| 64 | "_Getter": reflect.ValueOf((*_flag_Getter)(nil)), |
| 65 | "_Value": reflect.ValueOf((*_flag_Value)(nil)), |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // _flag_Getter is an interface wrapper for Getter type |
| 70 | type _flag_Getter struct { |
| 71 | IValue interface{} |
| 72 | WGet func() any |
| 73 | WSet func(a0 string) error |
| 74 | WString func() string |
| 75 | } |
| 76 | |
| 77 | func (W _flag_Getter) Get() any { return W.WGet() } |
| 78 | func (W _flag_Getter) Set(a0 string) error { return W.WSet(a0) } |
| 79 | func (W _flag_Getter) String() string { |
| 80 | if W.WString == nil { |
| 81 | return "" |
| 82 | } |
| 83 | return W.WString() |
| 84 | } |
| 85 | |
| 86 | // _flag_Value is an interface wrapper for Value type |
| 87 | type _flag_Value struct { |
| 88 | IValue interface{} |
| 89 | WSet func(a0 string) error |
| 90 | WString func() string |
| 91 | } |
| 92 | |
| 93 | func (W _flag_Value) Set(a0 string) error { return W.WSet(a0) } |
| 94 | func (W _flag_Value) String() string { |
| 95 | if W.WString == nil { |
| 96 | return "" |
| 97 | } |
| 98 | return W.WString() |
| 99 | } |