Debian Codegraph @

flag_int_slice.go

raw symbols SCIP
1 package cli
2
3 type (
4 IntSlice = SliceBase[int, IntegerConfig, intValue[int]]
5 Int8Slice = SliceBase[int8, IntegerConfig, intValue[int8]]
6 Int16Slice = SliceBase[int16, IntegerConfig, intValue[int16]]
7 Int32Slice = SliceBase[int32, IntegerConfig, intValue[int32]]
8 Int64Slice = SliceBase[int64, IntegerConfig, intValue[int64]]
9 IntSliceFlag = FlagBase[[]int, IntegerConfig, IntSlice]
10 Int8SliceFlag = FlagBase[[]int8, IntegerConfig, Int8Slice]
11 Int16SliceFlag = FlagBase[[]int16, IntegerConfig, Int16Slice]
12 Int32SliceFlag = FlagBase[[]int32, IntegerConfig, Int32Slice]
13 Int64SliceFlag = FlagBase[[]int64, IntegerConfig, Int64Slice]
14 )
15
16 var (
17 NewIntSlice = NewSliceBase[int, IntegerConfig, intValue[int]]
18 NewInt8Slice = NewSliceBase[int8, IntegerConfig, intValue[int8]]
19 NewInt16Slice = NewSliceBase[int16, IntegerConfig, intValue[int16]]
20 NewInt32Slice = NewSliceBase[int32, IntegerConfig, intValue[int32]]
21 NewInt64Slice = NewSliceBase[int64, IntegerConfig, intValue[int64]]
22 )
23
24 // IntSlice looks up the value of a local IntSliceFlag, returns
25 // nil if not found
26 func (cmd *Command) IntSlice(name string) []int {
27 return getNumberSlice[int](cmd, name)
28 }
29
30 // Int8Slice looks up the value of a local Int8SliceFlag, returns
31 // nil if not found
32 func (cmd *Command) Int8Slice(name string) []int8 {
33 return getNumberSlice[int8](cmd, name)
34 }
35
36 // Int16Slice looks up the value of a local Int16SliceFlag, returns
37 // nil if not found
38 func (cmd *Command) Int16Slice(name string) []int16 {
39 return getNumberSlice[int16](cmd, name)
40 }
41
42 // Int32Slice looks up the value of a local Int32SliceFlag, returns
43 // nil if not found
44 func (cmd *Command) Int32Slice(name string) []int32 {
45 return getNumberSlice[int32](cmd, name)
46 }
47
48 // Int64Slice looks up the value of a local Int64SliceFlag, returns
49 // nil if not found
50 func (cmd *Command) Int64Slice(name string) []int64 {
51 return getNumberSlice[int64](cmd, name)
52 }