src.elv.sh@v0.21.0-dev.0.20240515223629-06979efb9a2a/pkg/getopt/zstring.go (about) 1 // Code generated by "stringer -type=Config,Arity,ContextType -output=zstring.go"; DO NOT EDIT. 2 3 package getopt 4 5 import "strconv" 6 7 func _() { 8 // An "invalid array index" compiler error signifies that the constant values have changed. 9 // Re-run the stringer command to generate them again. 10 var x [1]struct{} 11 _ = x[StopAfterDoubleDash-1] 12 _ = x[StopBeforeFirstNonOption-2] 13 _ = x[LongOnly-4] 14 } 15 16 const ( 17 _Config_name_0 = "StopAfterDoubleDashStopBeforeFirstNonOption" 18 _Config_name_1 = "LongOnly" 19 ) 20 21 var ( 22 _Config_index_0 = [...]uint8{0, 19, 43} 23 ) 24 25 func (i Config) String() string { 26 switch { 27 case 1 <= i && i <= 2: 28 i -= 1 29 return _Config_name_0[_Config_index_0[i]:_Config_index_0[i+1]] 30 case i == 4: 31 return _Config_name_1 32 default: 33 return "Config(" + strconv.FormatInt(int64(i), 10) + ")" 34 } 35 } 36 func _() { 37 // An "invalid array index" compiler error signifies that the constant values have changed. 38 // Re-run the stringer command to generate them again. 39 var x [1]struct{} 40 _ = x[NoArgument-0] 41 _ = x[RequiredArgument-1] 42 _ = x[OptionalArgument-2] 43 } 44 45 const _Arity_name = "NoArgumentRequiredArgumentOptionalArgument" 46 47 var _Arity_index = [...]uint8{0, 10, 26, 42} 48 49 func (i Arity) String() string { 50 if i >= Arity(len(_Arity_index)-1) { 51 return "Arity(" + strconv.FormatInt(int64(i), 10) + ")" 52 } 53 return _Arity_name[_Arity_index[i]:_Arity_index[i+1]] 54 } 55 func _() { 56 // An "invalid array index" compiler error signifies that the constant values have changed. 57 // Re-run the stringer command to generate them again. 58 var x [1]struct{} 59 _ = x[OptionOrArgument-0] 60 _ = x[AnyOption-1] 61 _ = x[LongOption-2] 62 _ = x[ChainShortOption-3] 63 _ = x[OptionArgument-4] 64 _ = x[Argument-5] 65 } 66 67 const _ContextType_name = "OptionOrArgumentAnyOptionLongOptionChainShortOptionOptionArgumentArgument" 68 69 var _ContextType_index = [...]uint8{0, 16, 25, 35, 51, 65, 73} 70 71 func (i ContextType) String() string { 72 if i >= ContextType(len(_ContextType_index)-1) { 73 return "ContextType(" + strconv.FormatInt(int64(i), 10) + ")" 74 } 75 return _ContextType_name[_ContextType_index[i]:_ContextType_index[i+1]] 76 }