1// Copyright 2017 Google Inc.  All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package getopt
6
7// Int creates an option that parses its value as an integer.
8func Int(name rune, value int, helpvalue ...string) *int {
9	return CommandLine.Int(name, value, helpvalue...)
10}
11
12func (s *Set) Int(name rune, value int, helpvalue ...string) *int {
13	s.Flag(&value, name, helpvalue...)
14	return &value
15}
16
17func IntLong(name string, short rune, value int, helpvalue ...string) *int {
18	return CommandLine.IntLong(name, short, value, helpvalue...)
19}
20
21func (s *Set) IntLong(name string, short rune, value int, helpvalue ...string) *int {
22	s.FlagLong(&value, name, short, helpvalue...)
23	return &value
24}
25
26// Int16 creates an option that parses its value as a 16 bit integer.
27func Int16(name rune, value int16, helpvalue ...string) *int16 {
28	return CommandLine.Int16(name, value, helpvalue...)
29}
30
31func (s *Set) Int16(name rune, value int16, helpvalue ...string) *int16 {
32	s.Flag(&value, name, helpvalue...)
33	return &value
34}
35
36func Int16Long(name string, short rune, value int16, helpvalue ...string) *int16 {
37	return CommandLine.Int16Long(name, short, value, helpvalue...)
38}
39
40func (s *Set) Int16Long(name string, short rune, value int16, helpvalue ...string) *int16 {
41	s.FlagLong(&value, name, short, helpvalue...)
42	return &value
43}
44
45// Int32 creates an option that parses its value as a 32 bit integer.
46func Int32(name rune, value int32, helpvalue ...string) *int32 {
47	return CommandLine.Int32(name, value, helpvalue...)
48}
49
50func (s *Set) Int32(name rune, value int32, helpvalue ...string) *int32 {
51	s.Flag(&value, name, helpvalue...)
52	return &value
53}
54
55func Int32Long(name string, short rune, value int32, helpvalue ...string) *int32 {
56	return CommandLine.Int32Long(name, short, value, helpvalue...)
57}
58
59func (s *Set) Int32Long(name string, short rune, value int32, helpvalue ...string) *int32 {
60	s.FlagLong(&value, name, short, helpvalue...)
61	return &value
62}
63
64// Int64 creates an option that parses its value as a 64 bit integer.
65func Int64(name rune, value int64, helpvalue ...string) *int64 {
66	return CommandLine.Int64(name, value, helpvalue...)
67}
68
69func (s *Set) Int64(name rune, value int64, helpvalue ...string) *int64 {
70	s.Flag(&value, name, helpvalue...)
71	return &value
72}
73
74func Int64Long(name string, short rune, value int64, helpvalue ...string) *int64 {
75	return CommandLine.Int64Long(name, short, value, helpvalue...)
76}
77
78func (s *Set) Int64Long(name string, short rune, value int64, helpvalue ...string) *int64 {
79	s.FlagLong(&value, name, short, helpvalue...)
80	return &value
81}
82
83// Uint creates an option that parses its value as an unsigned integer.
84func Uint(name rune, value uint, helpvalue ...string) *uint {
85	return CommandLine.Uint(name, value, helpvalue...)
86}
87
88func (s *Set) Uint(name rune, value uint, helpvalue ...string) *uint {
89	s.Flag(&value, name, helpvalue...)
90	return &value
91}
92
93func UintLong(name string, short rune, value uint, helpvalue ...string) *uint {
94	return CommandLine.UintLong(name, short, value, helpvalue...)
95}
96
97func (s *Set) UintLong(name string, short rune, value uint, helpvalue ...string) *uint {
98	s.FlagLong(&value, name, short, helpvalue...)
99	return &value
100}
101
102// Uint16 creates an option that parses its value as a 16 bit unsigned integer.
103func Uint16(name rune, value uint16, helpvalue ...string) *uint16 {
104	return CommandLine.Uint16(name, value, helpvalue...)
105}
106
107func (s *Set) Uint16(name rune, value uint16, helpvalue ...string) *uint16 {
108	s.Flag(&value, name, helpvalue...)
109	return &value
110}
111
112func Uint16Long(name string, short rune, value uint16, helpvalue ...string) *uint16 {
113	return CommandLine.Uint16Long(name, short, value, helpvalue...)
114}
115
116func (s *Set) Uint16Long(name string, short rune, value uint16, helpvalue ...string) *uint16 {
117	s.FlagLong(&value, name, short, helpvalue...)
118	return &value
119}
120
121// Uint32 creates an option that parses its value as a 32 bit unsigned integer.
122func Uint32(name rune, value uint32, helpvalue ...string) *uint32 {
123	return CommandLine.Uint32(name, value, helpvalue...)
124}
125
126func (s *Set) Uint32(name rune, value uint32, helpvalue ...string) *uint32 {
127	s.Flag(&value, name, helpvalue...)
128	return &value
129}
130
131func Uint32Long(name string, short rune, value uint32, helpvalue ...string) *uint32 {
132	return CommandLine.Uint32Long(name, short, value, helpvalue...)
133}
134
135func (s *Set) Uint32Long(name string, short rune, value uint32, helpvalue ...string) *uint32 {
136	s.FlagLong(&value, name, short, helpvalue...)
137	return &value
138}
139
140// Uint64 creates an option that parses its value as a 64 bit unsigned integer.
141func Uint64(name rune, value uint64, helpvalue ...string) *uint64 {
142	return CommandLine.Uint64(name, value, helpvalue...)
143}
144
145func (s *Set) Uint64(name rune, value uint64, helpvalue ...string) *uint64 {
146	s.Flag(&value, name, helpvalue...)
147	return &value
148}
149
150func Uint64Long(name string, short rune, value uint64, helpvalue ...string) *uint64 {
151	return CommandLine.Uint64Long(name, short, value, helpvalue...)
152}
153
154func (s *Set) Uint64Long(name string, short rune, value uint64, helpvalue ...string) *uint64 {
155	s.FlagLong(&value, name, short, helpvalue...)
156	return &value
157}
158