id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
26,000
coocood/freecache
cache.go
ResetStatistics
func (cache *Cache) ResetStatistics() { for i := range cache.segments { cache.locks[i].Lock() cache.segments[i].resetStatistics() cache.locks[i].Unlock() } }
go
func (cache *Cache) ResetStatistics() { for i := range cache.segments { cache.locks[i].Lock() cache.segments[i].resetStatistics() cache.locks[i].Unlock() } }
[ "func", "(", "cache", "*", "Cache", ")", "ResetStatistics", "(", ")", "{", "for", "i", ":=", "range", "cache", ".", "segments", "{", "cache", ".", "locks", "[", "i", "]", ".", "Lock", "(", ")", "\n", "cache", ".", "segments", "[", "i", "]", ".", ...
// ResetStatistics refreshes the current state of the statistics.
[ "ResetStatistics", "refreshes", "the", "current", "state", "of", "the", "statistics", "." ]
142b9e1225b0ecdbe420d8fe6cef33f268670c42
https://github.com/coocood/freecache/blob/142b9e1225b0ecdbe420d8fe6cef33f268670c42/cache.go#L227-L233
26,001
coocood/freecache
ringbuf.go
Dump
func (rb *RingBuf) Dump() []byte { dump := make([]byte, len(rb.data)) copy(dump, rb.data) return dump }
go
func (rb *RingBuf) Dump() []byte { dump := make([]byte, len(rb.data)) copy(dump, rb.data) return dump }
[ "func", "(", "rb", "*", "RingBuf", ")", "Dump", "(", ")", "[", "]", "byte", "{", "dump", ":=", "make", "(", "[", "]", "byte", ",", "len", "(", "rb", ".", "data", ")", ")", "\n", "copy", "(", "dump", ",", "rb", ".", "data", ")", "\n", "retur...
// Create a copy of the buffer.
[ "Create", "a", "copy", "of", "the", "buffer", "." ]
142b9e1225b0ecdbe420d8fe6cef33f268670c42
https://github.com/coocood/freecache/blob/142b9e1225b0ecdbe420d8fe6cef33f268670c42/ringbuf.go#L31-L35
26,002
coocood/freecache
ringbuf.go
Evacuate
func (rb *RingBuf) Evacuate(off int64, length int) (newOff int64) { if off+int64(length) > rb.end || off < rb.begin { return -1 } var readOff int if rb.end-rb.begin < int64(len(rb.data)) { readOff = int(off - rb.begin) } else { readOff = rb.index + int(off-rb.begin) } if readOff >= len(rb.data) { readOff...
go
func (rb *RingBuf) Evacuate(off int64, length int) (newOff int64) { if off+int64(length) > rb.end || off < rb.begin { return -1 } var readOff int if rb.end-rb.begin < int64(len(rb.data)) { readOff = int(off - rb.begin) } else { readOff = rb.index + int(off-rb.begin) } if readOff >= len(rb.data) { readOff...
[ "func", "(", "rb", "*", "RingBuf", ")", "Evacuate", "(", "off", "int64", ",", "length", "int", ")", "(", "newOff", "int64", ")", "{", "if", "off", "+", "int64", "(", "length", ")", ">", "rb", ".", "end", "||", "off", "<", "rb", ".", "begin", "{...
// Evacuate read the data at off, then write it to the the data stream, // Keep it from being overwritten by new data.
[ "Evacuate", "read", "the", "data", "at", "off", "then", "write", "it", "to", "the", "the", "data", "stream", "Keep", "it", "from", "being", "overwritten", "by", "new", "data", "." ]
142b9e1225b0ecdbe420d8fe6cef33f268670c42
https://github.com/coocood/freecache/blob/142b9e1225b0ecdbe420d8fe6cef33f268670c42/ringbuf.go#L158-L207
26,003
huandu/facebook
paging_result.go
Previous
func (pr *PagingResult) Previous() (noMore bool, err error) { if !pr.HasPrevious() { noMore = true return } return pr.navigate(&pr.previous) }
go
func (pr *PagingResult) Previous() (noMore bool, err error) { if !pr.HasPrevious() { noMore = true return } return pr.navigate(&pr.previous) }
[ "func", "(", "pr", "*", "PagingResult", ")", "Previous", "(", ")", "(", "noMore", "bool", ",", "err", "error", ")", "{", "if", "!", "pr", ".", "HasPrevious", "(", ")", "{", "noMore", "=", "true", "\n", "return", "\n", "}", "\n\n", "return", "pr", ...
// Previous reads previous page.
[ "Previous", "reads", "previous", "page", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/paging_result.go#L64-L71
26,004
huandu/facebook
paging_result.go
Next
func (pr *PagingResult) Next() (noMore bool, err error) { if !pr.HasNext() { noMore = true return } return pr.navigate(&pr.next) }
go
func (pr *PagingResult) Next() (noMore bool, err error) { if !pr.HasNext() { noMore = true return } return pr.navigate(&pr.next) }
[ "func", "(", "pr", "*", "PagingResult", ")", "Next", "(", ")", "(", "noMore", "bool", ",", "err", "error", ")", "{", "if", "!", "pr", ".", "HasNext", "(", ")", "{", "noMore", "=", "true", "\n", "return", "\n", "}", "\n\n", "return", "pr", ".", ...
// Next reads next page.
[ "Next", "reads", "next", "page", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/paging_result.go#L74-L81
26,005
huandu/facebook
filedata.go
Data
func Data(filename string, source io.Reader) *BinaryData { return &BinaryData{ Filename: filename, Source: source, } }
go
func Data(filename string, source io.Reader) *BinaryData { return &BinaryData{ Filename: filename, Source: source, } }
[ "func", "Data", "(", "filename", "string", ",", "source", "io", ".", "Reader", ")", "*", "BinaryData", "{", "return", "&", "BinaryData", "{", "Filename", ":", "filename", ",", "Source", ":", "source", ",", "}", "\n", "}" ]
// Data creates new binary data holder.
[ "Data", "creates", "new", "binary", "data", "holder", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/filedata.go#L29-L34
26,006
huandu/facebook
filedata.go
DataWithContentType
func DataWithContentType(filename string, source io.Reader, contentType string) *BinaryData { return &BinaryData{ Filename: filename, Source: source, ContentType: contentType, } }
go
func DataWithContentType(filename string, source io.Reader, contentType string) *BinaryData { return &BinaryData{ Filename: filename, Source: source, ContentType: contentType, } }
[ "func", "DataWithContentType", "(", "filename", "string", ",", "source", "io", ".", "Reader", ",", "contentType", "string", ")", "*", "BinaryData", "{", "return", "&", "BinaryData", "{", "Filename", ":", "filename", ",", "Source", ":", "source", ",", "Conten...
// DataWithContentType creates new binary data holder with arbitrary content type.
[ "DataWithContentType", "creates", "new", "binary", "data", "holder", "with", "arbitrary", "content", "type", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/filedata.go#L37-L43
26,007
huandu/facebook
filedata.go
FileAlias
func FileAlias(filename, path string) *BinaryFile { return &BinaryFile{ Filename: filename, Path: path, } }
go
func FileAlias(filename, path string) *BinaryFile { return &BinaryFile{ Filename: filename, Path: path, } }
[ "func", "FileAlias", "(", "filename", ",", "path", "string", ")", "*", "BinaryFile", "{", "return", "&", "BinaryFile", "{", "Filename", ":", "filename", ",", "Path", ":", "path", ",", "}", "\n", "}" ]
// FileAlias creates a binary file holder and specific a different path for reading.
[ "FileAlias", "creates", "a", "binary", "file", "holder", "and", "specific", "a", "different", "path", "for", "reading", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/filedata.go#L53-L58
26,008
huandu/facebook
filedata.go
FileAliasWithContentType
func FileAliasWithContentType(filename, path, contentType string) *BinaryFile { if path == "" { path = filename } return &BinaryFile{ Filename: filename, Path: path, ContentType: contentType, } }
go
func FileAliasWithContentType(filename, path, contentType string) *BinaryFile { if path == "" { path = filename } return &BinaryFile{ Filename: filename, Path: path, ContentType: contentType, } }
[ "func", "FileAliasWithContentType", "(", "filename", ",", "path", ",", "contentType", "string", ")", "*", "BinaryFile", "{", "if", "path", "==", "\"", "\"", "{", "path", "=", "filename", "\n", "}", "\n\n", "return", "&", "BinaryFile", "{", "Filename", ":",...
// FileAliasWithContentType creates a new binary file holder with arbitrary content type.
[ "FileAliasWithContentType", "creates", "a", "new", "binary", "file", "holder", "with", "arbitrary", "content", "type", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/filedata.go#L61-L71
26,009
huandu/facebook
app.go
New
func New(appID, appSecret string) *App { return &App{ AppId: appID, AppSecret: appSecret, } }
go
func New(appID, appSecret string) *App { return &App{ AppId: appID, AppSecret: appSecret, } }
[ "func", "New", "(", "appID", ",", "appSecret", "string", ")", "*", "App", "{", "return", "&", "App", "{", "AppId", ":", "appID", ",", "AppSecret", ":", "appSecret", ",", "}", "\n", "}" ]
// New creates a new App and sets app id and secret.
[ "New", "creates", "a", "new", "App", "and", "sets", "app", "id", "and", "secret", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/app.go#L36-L41
26,010
huandu/facebook
app.go
ParseSignedRequest
func (app *App) ParseSignedRequest(signedRequest string) (res Result, err error) { strs := strings.SplitN(signedRequest, ".", 2) if len(strs) != 2 { err = fmt.Errorf("invalid signed request format") return } sig, e1 := base64.RawURLEncoding.DecodeString(strs[0]) if e1 != nil { err = fmt.Errorf("fail to de...
go
func (app *App) ParseSignedRequest(signedRequest string) (res Result, err error) { strs := strings.SplitN(signedRequest, ".", 2) if len(strs) != 2 { err = fmt.Errorf("invalid signed request format") return } sig, e1 := base64.RawURLEncoding.DecodeString(strs[0]) if e1 != nil { err = fmt.Errorf("fail to de...
[ "func", "(", "app", "*", "App", ")", "ParseSignedRequest", "(", "signedRequest", "string", ")", "(", "res", "Result", ",", "err", "error", ")", "{", "strs", ":=", "strings", ".", "SplitN", "(", "signedRequest", ",", "\"", "\"", ",", "2", ")", "\n\n", ...
// ParseSignedRequest parses signed request.
[ "ParseSignedRequest", "parses", "signed", "request", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/app.go#L49-L103
26,011
huandu/facebook
app.go
ExchangeToken
func (app *App) ExchangeToken(accessToken string) (token string, expires int, err error) { if accessToken == "" { err = fmt.Errorf("short lived accessToken is empty") return } var res Result res, err = defaultSession.sendOauthRequest("/oauth/access_token", Params{ "grant_type": "fb_exchange_token", ...
go
func (app *App) ExchangeToken(accessToken string) (token string, expires int, err error) { if accessToken == "" { err = fmt.Errorf("short lived accessToken is empty") return } var res Result res, err = defaultSession.sendOauthRequest("/oauth/access_token", Params{ "grant_type": "fb_exchange_token", ...
[ "func", "(", "app", "*", "App", ")", "ExchangeToken", "(", "accessToken", "string", ")", "(", "token", "string", ",", "expires", "int", ",", "err", "error", ")", "{", "if", "accessToken", "==", "\"", "\"", "{", "err", "=", "fmt", ".", "Errorf", "(", ...
// ExchangeToken exchanges a short-lived access token to a long-lived access token. // Return new access token and its expires time.
[ "ExchangeToken", "exchanges", "a", "short", "-", "lived", "access", "token", "to", "a", "long", "-", "lived", "access", "token", ".", "Return", "new", "access", "token", "and", "its", "expires", "time", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/app.go#L168-L204
26,012
huandu/facebook
app.go
GetCode
func (app *App) GetCode(accessToken string) (code string, err error) { if accessToken == "" { err = fmt.Errorf("long lived accessToken is empty") return } var res Result res, err = defaultSession.sendOauthRequest("/oauth/client_code", Params{ "client_id": app.AppId, "client_secret": app.AppSecret, "r...
go
func (app *App) GetCode(accessToken string) (code string, err error) { if accessToken == "" { err = fmt.Errorf("long lived accessToken is empty") return } var res Result res, err = defaultSession.sendOauthRequest("/oauth/client_code", Params{ "client_id": app.AppId, "client_secret": app.AppSecret, "r...
[ "func", "(", "app", "*", "App", ")", "GetCode", "(", "accessToken", "string", ")", "(", "code", "string", ",", "err", "error", ")", "{", "if", "accessToken", "==", "\"", "\"", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "re...
// GetCode gets code from a long lived access token. // Return the code retrieved from facebook.
[ "GetCode", "gets", "code", "from", "a", "long", "lived", "access", "token", ".", "Return", "the", "code", "retrieved", "from", "facebook", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/app.go#L208-L229
26,013
huandu/facebook
app.go
Session
func (app *App) Session(accessToken string) *Session { return &Session{ accessToken: accessToken, app: app, enableAppsecretProof: app.EnableAppsecretProof, } }
go
func (app *App) Session(accessToken string) *Session { return &Session{ accessToken: accessToken, app: app, enableAppsecretProof: app.EnableAppsecretProof, } }
[ "func", "(", "app", "*", "App", ")", "Session", "(", "accessToken", "string", ")", "*", "Session", "{", "return", "&", "Session", "{", "accessToken", ":", "accessToken", ",", "app", ":", "app", ",", "enableAppsecretProof", ":", "app", ".", "EnableAppsecret...
// Session creates a session based on current App setting.
[ "Session", "creates", "a", "session", "based", "on", "current", "App", "setting", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/app.go#L232-L238
26,014
huandu/facebook
app.go
SessionFromSignedRequest
func (app *App) SessionFromSignedRequest(signedRequest string) (session *Session, err error) { var res Result res, err = app.ParseSignedRequest(signedRequest) if err != nil { return } var id, token string res.DecodeField("user_id", &id) // it's ok without user id. err = res.DecodeField("oauth_token", &toke...
go
func (app *App) SessionFromSignedRequest(signedRequest string) (session *Session, err error) { var res Result res, err = app.ParseSignedRequest(signedRequest) if err != nil { return } var id, token string res.DecodeField("user_id", &id) // it's ok without user id. err = res.DecodeField("oauth_token", &toke...
[ "func", "(", "app", "*", "App", ")", "SessionFromSignedRequest", "(", "signedRequest", "string", ")", "(", "session", "*", "Session", ",", "err", "error", ")", "{", "var", "res", "Result", "\n\n", "res", ",", "err", "=", "app", ".", "ParseSignedRequest", ...
// SessionFromSignedRequest creates a session from a signed request. // If signed request contains a code, it will automatically use this code // to exchange a valid access token.
[ "SessionFromSignedRequest", "creates", "a", "session", "from", "a", "signed", "request", ".", "If", "signed", "request", "contains", "a", "code", "it", "will", "automatically", "use", "this", "code", "to", "exchange", "a", "valid", "access", "token", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/app.go#L243-L289
26,015
huandu/facebook
session.go
Api
func (session *Session) Api(path string, method Method, params Params) (Result, error) { return session.graph(path, method, params) }
go
func (session *Session) Api(path string, method Method, params Params) (Result, error) { return session.graph(path, method, params) }
[ "func", "(", "session", "*", "Session", ")", "Api", "(", "path", "string", ",", "method", "Method", ",", "params", "Params", ")", "(", "Result", ",", "error", ")", "{", "return", "session", ".", "graph", "(", "path", ",", "method", ",", "params", ")"...
// Api makes a facebook graph api call. // // If session access token is set, "access_token" in params will be set to the token value. // // Returns facebook graph api call result. // If facebook returns error in response, returns error details in res and set err.
[ "Api", "makes", "a", "facebook", "graph", "api", "call", ".", "If", "session", "access", "token", "is", "set", "access_token", "in", "params", "will", "be", "set", "to", "the", "token", "value", ".", "Returns", "facebook", "graph", "api", "call", "result",...
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L84-L86
26,016
huandu/facebook
session.go
User
func (session *Session) User() (id string, err error) { if session.id != "" { id = session.id return } if session.accessToken == "" && session.HttpClient == nil { err = fmt.Errorf("access token is not set") return } var result Result result, err = session.Api("/me", GET, Params{"fields": "id"}) if err...
go
func (session *Session) User() (id string, err error) { if session.id != "" { id = session.id return } if session.accessToken == "" && session.HttpClient == nil { err = fmt.Errorf("access token is not set") return } var result Result result, err = session.Api("/me", GET, Params{"fields": "id"}) if err...
[ "func", "(", "session", "*", "Session", ")", "User", "(", ")", "(", "id", "string", ",", "err", "error", ")", "{", "if", "session", ".", "id", "!=", "\"", "\"", "{", "id", "=", "session", ".", "id", "\n", "return", "\n", "}", "\n\n", "if", "ses...
// User gets current user id from access token. // // Returns error if access token is not set or invalid. // // It's a standard way to validate a facebook access token.
[ "User", "gets", "current", "user", "id", "from", "access", "token", ".", "Returns", "error", "if", "access", "token", "is", "not", "set", "or", "invalid", ".", "It", "s", "a", "standard", "way", "to", "validate", "a", "facebook", "access", "token", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L163-L188
26,017
huandu/facebook
session.go
Validate
func (session *Session) Validate() (err error) { if session.accessToken == "" && session.HttpClient == nil { err = fmt.Errorf("access token is not set") return } var result Result result, err = session.Api("/me", GET, Params{"fields": "id"}) if err != nil { return } if f := result.Get("id"); f == nil { ...
go
func (session *Session) Validate() (err error) { if session.accessToken == "" && session.HttpClient == nil { err = fmt.Errorf("access token is not set") return } var result Result result, err = session.Api("/me", GET, Params{"fields": "id"}) if err != nil { return } if f := result.Get("id"); f == nil { ...
[ "func", "(", "session", "*", "Session", ")", "Validate", "(", ")", "(", "err", "error", ")", "{", "if", "session", ".", "accessToken", "==", "\"", "\"", "&&", "session", ".", "HttpClient", "==", "nil", "{", "err", "=", "fmt", ".", "Errorf", "(", "\...
// Validate validates Session access token. // Returns nil if access token is valid.
[ "Validate", "validates", "Session", "access", "token", ".", "Returns", "nil", "if", "access", "token", "is", "valid", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L192-L211
26,018
huandu/facebook
session.go
SetAccessToken
func (session *Session) SetAccessToken(token string) { if token != session.accessToken { session.id = "" session.accessToken = token session.appsecretProof = "" } }
go
func (session *Session) SetAccessToken(token string) { if token != session.accessToken { session.id = "" session.accessToken = token session.appsecretProof = "" } }
[ "func", "(", "session", "*", "Session", ")", "SetAccessToken", "(", "token", "string", ")", "{", "if", "token", "!=", "session", ".", "accessToken", "{", "session", ".", "id", "=", "\"", "\"", "\n", "session", ".", "accessToken", "=", "token", "\n", "s...
// SetAccessToken sets a new access token.
[ "SetAccessToken", "sets", "a", "new", "access", "token", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L263-L269
26,019
huandu/facebook
session.go
AppsecretProof
func (session *Session) AppsecretProof() string { if !session.enableAppsecretProof { return "" } if session.accessToken == "" || session.app == nil { return "" } if session.appsecretProof == "" { hash := hmac.New(sha256.New, []byte(session.app.AppSecret)) hash.Write([]byte(session.accessToken)) session...
go
func (session *Session) AppsecretProof() string { if !session.enableAppsecretProof { return "" } if session.accessToken == "" || session.app == nil { return "" } if session.appsecretProof == "" { hash := hmac.New(sha256.New, []byte(session.app.AppSecret)) hash.Write([]byte(session.accessToken)) session...
[ "func", "(", "session", "*", "Session", ")", "AppsecretProof", "(", ")", "string", "{", "if", "!", "session", ".", "enableAppsecretProof", "{", "return", "\"", "\"", "\n", "}", "\n\n", "if", "session", ".", "accessToken", "==", "\"", "\"", "||", "session...
// AppsecretProof checks appsecret proof is enabled or not.
[ "AppsecretProof", "checks", "appsecret", "proof", "is", "enabled", "or", "not", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L272-L288
26,020
huandu/facebook
session.go
EnableAppsecretProof
func (session *Session) EnableAppsecretProof(enabled bool) error { if session.app == nil { return fmt.Errorf("cannot change appsecret proof status without an associated App") } if session.enableAppsecretProof != enabled { session.enableAppsecretProof = enabled // reset pre-calculated proof here to give calle...
go
func (session *Session) EnableAppsecretProof(enabled bool) error { if session.app == nil { return fmt.Errorf("cannot change appsecret proof status without an associated App") } if session.enableAppsecretProof != enabled { session.enableAppsecretProof = enabled // reset pre-calculated proof here to give calle...
[ "func", "(", "session", "*", "Session", ")", "EnableAppsecretProof", "(", "enabled", "bool", ")", "error", "{", "if", "session", ".", "app", "==", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "session", "...
// EnableAppsecretProof enables or disable appsecret proof status. // Returns error if there is no App associated with this Session.
[ "EnableAppsecretProof", "enables", "or", "disable", "appsecret", "proof", "status", ".", "Returns", "error", "if", "there", "is", "no", "App", "associated", "with", "this", "Session", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L292-L306
26,021
huandu/facebook
session.go
Debug
func (session *Session) Debug() DebugMode { if session.debug != DEBUG_OFF { return session.debug } return Debug }
go
func (session *Session) Debug() DebugMode { if session.debug != DEBUG_OFF { return session.debug } return Debug }
[ "func", "(", "session", "*", "Session", ")", "Debug", "(", ")", "DebugMode", "{", "if", "session", ".", "debug", "!=", "DEBUG_OFF", "{", "return", "session", ".", "debug", "\n", "}", "\n\n", "return", "Debug", "\n", "}" ]
// Debug returns current debug mode.
[ "Debug", "returns", "current", "debug", "mode", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L314-L320
26,022
huandu/facebook
session.go
SetDebug
func (session *Session) SetDebug(debug DebugMode) DebugMode { old := session.debug session.debug = debug return old }
go
func (session *Session) SetDebug(debug DebugMode) DebugMode { old := session.debug session.debug = debug return old }
[ "func", "(", "session", "*", "Session", ")", "SetDebug", "(", "debug", "DebugMode", ")", "DebugMode", "{", "old", ":=", "session", ".", "debug", "\n", "session", ".", "debug", "=", "debug", "\n", "return", "old", "\n", "}" ]
// SetDebug updates per session debug mode and returns old mode. // If per session debug mode is DEBUG_OFF, session will use global // Debug mode.
[ "SetDebug", "updates", "per", "session", "debug", "mode", "and", "returns", "old", "mode", ".", "If", "per", "session", "debug", "mode", "is", "DEBUG_OFF", "session", "will", "use", "global", "Debug", "mode", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L325-L329
26,023
huandu/facebook
session.go
WithContext
func (session *Session) WithContext(ctx context.Context) *Session { s := *session s.context = ctx return &s }
go
func (session *Session) WithContext(ctx context.Context) *Session { s := *session s.context = ctx return &s }
[ "func", "(", "session", "*", "Session", ")", "WithContext", "(", "ctx", "context", ".", "Context", ")", "*", "Session", "{", "s", ":=", "*", "session", "\n", "s", ".", "context", "=", "ctx", "\n", "return", "&", "s", "\n", "}" ]
// WithContext returns a shallow copy of session with its context changed to ctx. // The provided ctx must be non-nil.
[ "WithContext", "returns", "a", "shallow", "copy", "of", "session", "with", "its", "context", "changed", "to", "ctx", ".", "The", "provided", "ctx", "must", "be", "non", "-", "nil", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/session.go#L656-L660
26,024
huandu/facebook
result.go
MakeResult
func MakeResult(jsonBytes []byte) (Result, error) { res := Result{} err := makeResult(jsonBytes, &res) if err != nil { return nil, err } // facebook may return an error return res, res.Err() }
go
func MakeResult(jsonBytes []byte) (Result, error) { res := Result{} err := makeResult(jsonBytes, &res) if err != nil { return nil, err } // facebook may return an error return res, res.Err() }
[ "func", "MakeResult", "(", "jsonBytes", "[", "]", "byte", ")", "(", "Result", ",", "error", ")", "{", "res", ":=", "Result", "{", "}", "\n", "err", ":=", "makeResult", "(", "jsonBytes", ",", "&", "res", ")", "\n\n", "if", "err", "!=", "nil", "{", ...
// MakeResult makes a Result from facebook Graph API response.
[ "MakeResult", "makes", "a", "Result", "from", "facebook", "Graph", "API", "response", "." ]
2d3753b3eead5325f72a52b940da5d36ed611aa4
https://github.com/huandu/facebook/blob/2d3753b3eead5325f72a52b940da5d36ed611aa4/result.go#L129-L139
26,025
alecthomas/kingpin
app.go
New
func New(name, help string) *Application { a := &Application{ Name: name, Help: help, errorWriter: os.Stderr, // Left for backwards compatibility purposes. usageWriter: os.Stderr, usageTemplate: DefaultUsageTemplate, terminate: os.Exit, } a.flagGroup = newFlagGroup() a.argGroup...
go
func New(name, help string) *Application { a := &Application{ Name: name, Help: help, errorWriter: os.Stderr, // Left for backwards compatibility purposes. usageWriter: os.Stderr, usageTemplate: DefaultUsageTemplate, terminate: os.Exit, } a.flagGroup = newFlagGroup() a.argGroup...
[ "func", "New", "(", "name", ",", "help", "string", ")", "*", "Application", "{", "a", ":=", "&", "Application", "{", "Name", ":", "name", ",", "Help", ":", "help", ",", "errorWriter", ":", "os", ".", "Stderr", ",", "// Left for backwards compatibility purp...
// New creates a new Kingpin application instance.
[ "New", "creates", "a", "new", "Kingpin", "application", "instance", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L50-L71
26,026
alecthomas/kingpin
app.go
ErrorWriter
func (a *Application) ErrorWriter(w io.Writer) *Application { a.errorWriter = w return a }
go
func (a *Application) ErrorWriter(w io.Writer) *Application { a.errorWriter = w return a }
[ "func", "(", "a", "*", "Application", ")", "ErrorWriter", "(", "w", "io", ".", "Writer", ")", "*", "Application", "{", "a", ".", "errorWriter", "=", "w", "\n", "return", "a", "\n", "}" ]
// ErrorWriter sets the io.Writer to use for errors.
[ "ErrorWriter", "sets", "the", "io", ".", "Writer", "to", "use", "for", "errors", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L138-L141
26,027
alecthomas/kingpin
app.go
UsageWriter
func (a *Application) UsageWriter(w io.Writer) *Application { a.usageWriter = w return a }
go
func (a *Application) UsageWriter(w io.Writer) *Application { a.usageWriter = w return a }
[ "func", "(", "a", "*", "Application", ")", "UsageWriter", "(", "w", "io", ".", "Writer", ")", "*", "Application", "{", "a", ".", "usageWriter", "=", "w", "\n", "return", "a", "\n", "}" ]
// UsageWriter sets the io.Writer to use for errors.
[ "UsageWriter", "sets", "the", "io", ".", "Writer", "to", "use", "for", "errors", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L144-L147
26,028
alecthomas/kingpin
app.go
UsageTemplate
func (a *Application) UsageTemplate(template string) *Application { a.usageTemplate = template return a }
go
func (a *Application) UsageTemplate(template string) *Application { a.usageTemplate = template return a }
[ "func", "(", "a", "*", "Application", ")", "UsageTemplate", "(", "template", "string", ")", "*", "Application", "{", "a", ".", "usageTemplate", "=", "template", "\n", "return", "a", "\n", "}" ]
// UsageTemplate specifies the text template to use when displaying usage // information. The default is UsageTemplate.
[ "UsageTemplate", "specifies", "the", "text", "template", "to", "use", "when", "displaying", "usage", "information", ".", "The", "default", "is", "UsageTemplate", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L151-L154
26,029
alecthomas/kingpin
app.go
ParseContext
func (a *Application) ParseContext(args []string) (*ParseContext, error) { return a.parseContext(false, args) }
go
func (a *Application) ParseContext(args []string) (*ParseContext, error) { return a.parseContext(false, args) }
[ "func", "(", "a", "*", "Application", ")", "ParseContext", "(", "args", "[", "]", "string", ")", "(", "*", "ParseContext", ",", "error", ")", "{", "return", "a", ".", "parseContext", "(", "false", ",", "args", ")", "\n", "}" ]
// ParseContext parses the given command line and returns the fully populated // ParseContext.
[ "ParseContext", "parses", "the", "given", "command", "line", "and", "returns", "the", "fully", "populated", "ParseContext", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L164-L166
26,030
alecthomas/kingpin
app.go
Parse
func (a *Application) Parse(args []string) (command string, err error) { context, parseErr := a.ParseContext(args) selected := []string{} var setValuesErr error if context == nil { // Since we do not throw error immediately, there could be a case // where a context returns nil. Protect against that. return ...
go
func (a *Application) Parse(args []string) (command string, err error) { context, parseErr := a.ParseContext(args) selected := []string{} var setValuesErr error if context == nil { // Since we do not throw error immediately, there could be a case // where a context returns nil. Protect against that. return ...
[ "func", "(", "a", "*", "Application", ")", "Parse", "(", "args", "[", "]", "string", ")", "(", "command", "string", ",", "err", "error", ")", "{", "context", ",", "parseErr", ":=", "a", ".", "ParseContext", "(", "args", ")", "\n", "selected", ":=", ...
// Parse parses command-line arguments. It returns the selected command and an // error. The selected command will be a space separated subcommand, if // subcommands have been configured. // // This will populate all flag and argument values, call all callbacks, and so // on.
[ "Parse", "parses", "command", "-", "line", "arguments", ".", "It", "returns", "the", "selected", "command", "and", "an", "error", ".", "The", "selected", "command", "will", "be", "a", "space", "separated", "subcommand", "if", "subcommands", "have", "been", "...
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L183-L228
26,031
alecthomas/kingpin
app.go
Author
func (a *Application) Author(author string) *Application { a.author = author return a }
go
func (a *Application) Author(author string) *Application { a.author = author return a }
[ "func", "(", "a", "*", "Application", ")", "Author", "(", "author", "string", ")", "*", "Application", "{", "a", ".", "author", "=", "author", "\n", "return", "a", "\n", "}" ]
// Author sets the author output by some help templates.
[ "Author", "sets", "the", "author", "output", "by", "some", "help", "templates", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L267-L270
26,032
alecthomas/kingpin
app.go
PreAction
func (a *Application) PreAction(action Action) *Application { a.addPreAction(action) return a }
go
func (a *Application) PreAction(action Action) *Application { a.addPreAction(action) return a }
[ "func", "(", "a", "*", "Application", ")", "PreAction", "(", "action", "Action", ")", "*", "Application", "{", "a", ".", "addPreAction", "(", "action", ")", "\n", "return", "a", "\n", "}" ]
// Action called after parsing completes but before validation and execution.
[ "Action", "called", "after", "parsing", "completes", "but", "before", "validation", "and", "execution", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L283-L286
26,033
alecthomas/kingpin
app.go
Command
func (a *Application) Command(name, help string) *CmdClause { return a.addCommand(name, help) }
go
func (a *Application) Command(name, help string) *CmdClause { return a.addCommand(name, help) }
[ "func", "(", "a", "*", "Application", ")", "Command", "(", "name", ",", "help", "string", ")", "*", "CmdClause", "{", "return", "a", ".", "addCommand", "(", "name", ",", "help", ")", "\n", "}" ]
// Command adds a new top-level command.
[ "Command", "adds", "a", "new", "top", "-", "level", "command", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L289-L291
26,034
alecthomas/kingpin
app.go
checkDuplicateFlags
func checkDuplicateFlags(current *CmdClause, flagGroups []*flagGroup) error { // Check for duplicates. for _, flags := range flagGroups { for _, flag := range current.flagOrder { if flag.shorthand != 0 { if _, ok := flags.short[string(flag.shorthand)]; ok { return fmt.Errorf("duplicate short flag -%c", ...
go
func checkDuplicateFlags(current *CmdClause, flagGroups []*flagGroup) error { // Check for duplicates. for _, flags := range flagGroups { for _, flag := range current.flagOrder { if flag.shorthand != 0 { if _, ok := flags.short[string(flag.shorthand)]; ok { return fmt.Errorf("duplicate short flag -%c", ...
[ "func", "checkDuplicateFlags", "(", "current", "*", "CmdClause", ",", "flagGroups", "[", "]", "*", "flagGroup", ")", "error", "{", "// Check for duplicates.", "for", "_", ",", "flags", ":=", "range", "flagGroups", "{", "for", "_", ",", "flag", ":=", "range",...
// Recursively check commands for duplicate flags.
[ "Recursively", "check", "commands", "for", "duplicate", "flags", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L355-L377
26,035
alecthomas/kingpin
app.go
Fatalf
func (a *Application) Fatalf(format string, args ...interface{}) { a.Errorf(format, args...) a.terminate(1) }
go
func (a *Application) Fatalf(format string, args ...interface{}) { a.Errorf(format, args...) a.terminate(1) }
[ "func", "(", "a", "*", "Application", ")", "Fatalf", "(", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "a", ".", "Errorf", "(", "format", ",", "args", "...", ")", "\n", "a", ".", "terminate", "(", "1", ")", "\n", "}" ]
// Fatalf writes a formatted error to w then terminates with exit status 1.
[ "Fatalf", "writes", "a", "formatted", "error", "to", "w", "then", "terminates", "with", "exit", "status", "1", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L571-L574
26,036
alecthomas/kingpin
app.go
FatalUsage
func (a *Application) FatalUsage(format string, args ...interface{}) { a.Errorf(format, args...) // Force usage to go to error output. a.usageWriter = a.errorWriter a.Usage([]string{}) a.terminate(1) }
go
func (a *Application) FatalUsage(format string, args ...interface{}) { a.Errorf(format, args...) // Force usage to go to error output. a.usageWriter = a.errorWriter a.Usage([]string{}) a.terminate(1) }
[ "func", "(", "a", "*", "Application", ")", "FatalUsage", "(", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "a", ".", "Errorf", "(", "format", ",", "args", "...", ")", "\n", "// Force usage to go to error output.", "a", ".", "u...
// FatalUsage prints an error message followed by usage information, then // exits with a non-zero status.
[ "FatalUsage", "prints", "an", "error", "message", "followed", "by", "usage", "information", "then", "exits", "with", "a", "non", "-", "zero", "status", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L578-L584
26,037
alecthomas/kingpin
app.go
FatalUsageContext
func (a *Application) FatalUsageContext(context *ParseContext, format string, args ...interface{}) { a.Errorf(format, args...) if err := a.UsageForContext(context); err != nil { panic(err) } a.terminate(1) }
go
func (a *Application) FatalUsageContext(context *ParseContext, format string, args ...interface{}) { a.Errorf(format, args...) if err := a.UsageForContext(context); err != nil { panic(err) } a.terminate(1) }
[ "func", "(", "a", "*", "Application", ")", "FatalUsageContext", "(", "context", "*", "ParseContext", ",", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "a", ".", "Errorf", "(", "format", ",", "args", "...", ")", "\n", "if", ...
// FatalUsageContext writes a printf formatted error message to w, then usage // information for the given ParseContext, before exiting.
[ "FatalUsageContext", "writes", "a", "printf", "formatted", "error", "message", "to", "w", "then", "usage", "information", "for", "the", "given", "ParseContext", "before", "exiting", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L588-L594
26,038
alecthomas/kingpin
app.go
FatalIfError
func (a *Application) FatalIfError(err error, format string, args ...interface{}) { if err != nil { prefix := "" if format != "" { prefix = fmt.Sprintf(format, args...) + ": " } a.Errorf(prefix+"%s", err) a.terminate(1) } }
go
func (a *Application) FatalIfError(err error, format string, args ...interface{}) { if err != nil { prefix := "" if format != "" { prefix = fmt.Sprintf(format, args...) + ": " } a.Errorf(prefix+"%s", err) a.terminate(1) } }
[ "func", "(", "a", "*", "Application", ")", "FatalIfError", "(", "err", "error", ",", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "if", "err", "!=", "nil", "{", "prefix", ":=", "\"", "\"", "\n", "if", "format", "!=", "\"...
// FatalIfError prints an error and exits if err is not nil. The error is printed // with the given formatted string, if any.
[ "FatalIfError", "prints", "an", "error", "and", "exits", "if", "err", "is", "not", "nil", ".", "The", "error", "is", "printed", "with", "the", "given", "formatted", "string", "if", "any", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/app.go#L598-L607
26,039
alecthomas/kingpin
flags.go
Flag
func (f *flagGroup) Flag(name, help string) *FlagClause { flag := newFlag(name, help) f.long[name] = flag f.flagOrder = append(f.flagOrder, flag) return flag }
go
func (f *flagGroup) Flag(name, help string) *FlagClause { flag := newFlag(name, help) f.long[name] = flag f.flagOrder = append(f.flagOrder, flag) return flag }
[ "func", "(", "f", "*", "flagGroup", ")", "Flag", "(", "name", ",", "help", "string", ")", "*", "FlagClause", "{", "flag", ":=", "newFlag", "(", "name", ",", "help", ")", "\n", "f", ".", "long", "[", "name", "]", "=", "flag", "\n", "f", ".", "fl...
// Flag defines a new flag with the given long name and help.
[ "Flag", "defines", "a", "new", "flag", "with", "the", "given", "long", "name", "and", "help", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/flags.go#L30-L35
26,040
alecthomas/kingpin
flags.go
Action
func (f *FlagClause) Action(action Action) *FlagClause { f.addAction(action) return f }
go
func (f *FlagClause) Action(action Action) *FlagClause { f.addAction(action) return f }
[ "func", "(", "f", "*", "FlagClause", ")", "Action", "(", "action", "Action", ")", "*", "FlagClause", "{", "f", ".", "addAction", "(", "action", ")", "\n", "return", "f", "\n", "}" ]
// Dispatch to the given function after the flag is parsed and validated.
[ "Dispatch", "to", "the", "given", "function", "after", "the", "flag", "is", "parsed", "and", "validated", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/flags.go#L220-L223
26,041
alecthomas/kingpin
flags.go
IsSetByUser
func (f *FlagClause) IsSetByUser(setByUser *bool) *FlagClause { if setByUser != nil { *setByUser = false } f.setByUser = setByUser return f }
go
func (f *FlagClause) IsSetByUser(setByUser *bool) *FlagClause { if setByUser != nil { *setByUser = false } f.setByUser = setByUser return f }
[ "func", "(", "f", "*", "FlagClause", ")", "IsSetByUser", "(", "setByUser", "*", "bool", ")", "*", "FlagClause", "{", "if", "setByUser", "!=", "nil", "{", "*", "setByUser", "=", "false", "\n", "}", "\n", "f", ".", "setByUser", "=", "setByUser", "\n", ...
// IsSetByUser let to know if the flag was set by the user
[ "IsSetByUser", "let", "to", "know", "if", "the", "flag", "was", "set", "by", "the", "user" ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/flags.go#L259-L265
26,042
alecthomas/kingpin
flags.go
Short
func (f *FlagClause) Short(name rune) *FlagClause { f.shorthand = name return f }
go
func (f *FlagClause) Short(name rune) *FlagClause { f.shorthand = name return f }
[ "func", "(", "f", "*", "FlagClause", ")", "Short", "(", "name", "rune", ")", "*", "FlagClause", "{", "f", ".", "shorthand", "=", "name", "\n", "return", "f", "\n", "}" ]
// Short sets the short flag name.
[ "Short", "sets", "the", "short", "flag", "name", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/flags.go#L316-L319
26,043
alecthomas/kingpin
flags.go
Bool
func (f *FlagClause) Bool() (target *bool) { target = new(bool) f.SetValue(newBoolValue(target)) return }
go
func (f *FlagClause) Bool() (target *bool) { target = new(bool) f.SetValue(newBoolValue(target)) return }
[ "func", "(", "f", "*", "FlagClause", ")", "Bool", "(", ")", "(", "target", "*", "bool", ")", "{", "target", "=", "new", "(", "bool", ")", "\n", "f", ".", "SetValue", "(", "newBoolValue", "(", "target", ")", ")", "\n", "return", "\n", "}" ]
// Bool makes this flag a boolean flag.
[ "Bool", "makes", "this", "flag", "a", "boolean", "flag", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/flags.go#L322-L326
26,044
alecthomas/kingpin
parsers.go
Bytes
func (p *parserMixin) Bytes() (target *units.Base2Bytes) { target = new(units.Base2Bytes) p.BytesVar(target) return }
go
func (p *parserMixin) Bytes() (target *units.Base2Bytes) { target = new(units.Base2Bytes) p.BytesVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Bytes", "(", ")", "(", "target", "*", "units", ".", "Base2Bytes", ")", "{", "target", "=", "new", "(", "units", ".", "Base2Bytes", ")", "\n", "p", ".", "BytesVar", "(", "target", ")", "\n", "return", "\n"...
// Bytes parses numeric byte units. eg. 1.5KB
[ "Bytes", "parses", "numeric", "byte", "units", ".", "eg", ".", "1", ".", "5KB" ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L40-L44
26,045
alecthomas/kingpin
parsers.go
ExistingFile
func (p *parserMixin) ExistingFile() (target *string) { target = new(string) p.ExistingFileVar(target) return }
go
func (p *parserMixin) ExistingFile() (target *string) { target = new(string) p.ExistingFileVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ExistingFile", "(", ")", "(", "target", "*", "string", ")", "{", "target", "=", "new", "(", "string", ")", "\n", "p", ".", "ExistingFileVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// ExistingFile sets the parser to one that requires and returns an existing file.
[ "ExistingFile", "sets", "the", "parser", "to", "one", "that", "requires", "and", "returns", "an", "existing", "file", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L66-L70
26,046
alecthomas/kingpin
parsers.go
ExistingDir
func (p *parserMixin) ExistingDir() (target *string) { target = new(string) p.ExistingDirVar(target) return }
go
func (p *parserMixin) ExistingDir() (target *string) { target = new(string) p.ExistingDirVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ExistingDir", "(", ")", "(", "target", "*", "string", ")", "{", "target", "=", "new", "(", "string", ")", "\n", "p", ".", "ExistingDirVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// ExistingDir sets the parser to one that requires and returns an existing directory.
[ "ExistingDir", "sets", "the", "parser", "to", "one", "that", "requires", "and", "returns", "an", "existing", "directory", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L73-L77
26,047
alecthomas/kingpin
parsers.go
ExistingFileOrDir
func (p *parserMixin) ExistingFileOrDir() (target *string) { target = new(string) p.ExistingFileOrDirVar(target) return }
go
func (p *parserMixin) ExistingFileOrDir() (target *string) { target = new(string) p.ExistingFileOrDirVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ExistingFileOrDir", "(", ")", "(", "target", "*", "string", ")", "{", "target", "=", "new", "(", "string", ")", "\n", "p", ".", "ExistingFileOrDirVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// ExistingFileOrDir sets the parser to one that requires and returns an existing file OR directory.
[ "ExistingFileOrDir", "sets", "the", "parser", "to", "one", "that", "requires", "and", "returns", "an", "existing", "file", "OR", "directory", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L80-L84
26,048
alecthomas/kingpin
parsers.go
File
func (p *parserMixin) File() (target **os.File) { target = new(*os.File) p.FileVar(target) return }
go
func (p *parserMixin) File() (target **os.File) { target = new(*os.File) p.FileVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "File", "(", ")", "(", "target", "*", "*", "os", ".", "File", ")", "{", "target", "=", "new", "(", "*", "os", ".", "File", ")", "\n", "p", ".", "FileVar", "(", "target", ")", "\n", "return", "\n", "}...
// File returns an os.File against an existing file.
[ "File", "returns", "an", "os", ".", "File", "against", "an", "existing", "file", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L87-L91
26,049
alecthomas/kingpin
parsers.go
BytesVar
func (p *parserMixin) BytesVar(target *units.Base2Bytes) { p.SetValue(newBytesValue(target)) }
go
func (p *parserMixin) BytesVar(target *units.Base2Bytes) { p.SetValue(newBytesValue(target)) }
[ "func", "(", "p", "*", "parserMixin", ")", "BytesVar", "(", "target", "*", "units", ".", "Base2Bytes", ")", "{", "p", ".", "SetValue", "(", "newBytesValue", "(", "target", ")", ")", "\n", "}" ]
// BytesVar parses numeric byte units. eg. 1.5KB
[ "BytesVar", "parses", "numeric", "byte", "units", ".", "eg", ".", "1", ".", "5KB" ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L128-L130
26,050
alecthomas/kingpin
parsers.go
FileVar
func (p *parserMixin) FileVar(target **os.File) { p.SetValue(newFileValue(target, os.O_RDONLY, 0)) }
go
func (p *parserMixin) FileVar(target **os.File) { p.SetValue(newFileValue(target, os.O_RDONLY, 0)) }
[ "func", "(", "p", "*", "parserMixin", ")", "FileVar", "(", "target", "*", "*", "os", ".", "File", ")", "{", "p", ".", "SetValue", "(", "newFileValue", "(", "target", ",", "os", ".", "O_RDONLY", ",", "0", ")", ")", "\n", "}" ]
// FileVar opens an existing file.
[ "FileVar", "opens", "an", "existing", "file", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L153-L155
26,051
alecthomas/kingpin
parsers.go
URLList
func (p *parserMixin) URLList() (target *[]*url.URL) { target = new([]*url.URL) p.URLListVar(target) return }
go
func (p *parserMixin) URLList() (target *[]*url.URL) { target = new([]*url.URL) p.URLListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "URLList", "(", ")", "(", "target", "*", "[", "]", "*", "url", ".", "URL", ")", "{", "target", "=", "new", "(", "[", "]", "*", "url", ".", "URL", ")", "\n", "p", ".", "URLListVar", "(", "target", ")"...
// URLList provides a parsed list of url.URL values.
[ "URLList", "provides", "a", "parsed", "list", "of", "url", ".", "URL", "values", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L168-L172
26,052
alecthomas/kingpin
parsers.go
URLListVar
func (p *parserMixin) URLListVar(target *[]*url.URL) { p.SetValue(newURLListValue(target)) }
go
func (p *parserMixin) URLListVar(target *[]*url.URL) { p.SetValue(newURLListValue(target)) }
[ "func", "(", "p", "*", "parserMixin", ")", "URLListVar", "(", "target", "*", "[", "]", "*", "url", ".", "URL", ")", "{", "p", ".", "SetValue", "(", "newURLListValue", "(", "target", ")", ")", "\n", "}" ]
// URLListVar provides a parsed list of url.URL values.
[ "URLListVar", "provides", "a", "parsed", "list", "of", "url", ".", "URL", "values", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L175-L177
26,053
alecthomas/kingpin
parsers.go
Enum
func (p *parserMixin) Enum(options ...string) (target *string) { target = new(string) p.EnumVar(target, options...) return }
go
func (p *parserMixin) Enum(options ...string) (target *string) { target = new(string) p.EnumVar(target, options...) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Enum", "(", "options", "...", "string", ")", "(", "target", "*", "string", ")", "{", "target", "=", "new", "(", "string", ")", "\n", "p", ".", "EnumVar", "(", "target", ",", "options", "...", ")", "\n", ...
// Enum allows a value from a set of options.
[ "Enum", "allows", "a", "value", "from", "a", "set", "of", "options", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L180-L184
26,054
alecthomas/kingpin
parsers.go
Enums
func (p *parserMixin) Enums(options ...string) (target *[]string) { target = new([]string) p.EnumsVar(target, options...) return }
go
func (p *parserMixin) Enums(options ...string) (target *[]string) { target = new([]string) p.EnumsVar(target, options...) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Enums", "(", "options", "...", "string", ")", "(", "target", "*", "[", "]", "string", ")", "{", "target", "=", "new", "(", "[", "]", "string", ")", "\n", "p", ".", "EnumsVar", "(", "target", ",", "optio...
// Enums allows a set of values from a set of options.
[ "Enums", "allows", "a", "set", "of", "values", "from", "a", "set", "of", "options", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L192-L196
26,055
alecthomas/kingpin
parsers.go
Counter
func (p *parserMixin) Counter() (target *int) { target = new(int) p.CounterVar(target) return }
go
func (p *parserMixin) Counter() (target *int) { target = new(int) p.CounterVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Counter", "(", ")", "(", "target", "*", "int", ")", "{", "target", "=", "new", "(", "int", ")", "\n", "p", ".", "CounterVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// A Counter increments a number each time it is encountered.
[ "A", "Counter", "increments", "a", "number", "each", "time", "it", "is", "encountered", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/parsers.go#L204-L208
26,056
alecthomas/kingpin
values_generated.go
Bool
func (p *parserMixin) Bool() (target *bool) { target = new(bool) p.BoolVar(target) return }
go
func (p *parserMixin) Bool() (target *bool) { target = new(bool) p.BoolVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Bool", "(", ")", "(", "target", "*", "bool", ")", "{", "target", "=", "new", "(", "bool", ")", "\n", "p", ".", "BoolVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Bool parses the next command-line value as bool.
[ "Bool", "parses", "the", "next", "command", "-", "line", "value", "as", "bool", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L34-L38
26,057
alecthomas/kingpin
values_generated.go
BoolList
func (p *parserMixin) BoolList() (target *[]bool) { target = new([]bool) p.BoolListVar(target) return }
go
func (p *parserMixin) BoolList() (target *[]bool) { target = new([]bool) p.BoolListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "BoolList", "(", ")", "(", "target", "*", "[", "]", "bool", ")", "{", "target", "=", "new", "(", "[", "]", "bool", ")", "\n", "p", ".", "BoolListVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// BoolList accumulates bool values into a slice.
[ "BoolList", "accumulates", "bool", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L45-L49
26,058
alecthomas/kingpin
values_generated.go
String
func (p *parserMixin) String() (target *string) { target = new(string) p.StringVar(target) return }
go
func (p *parserMixin) String() (target *string) { target = new(string) p.StringVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "String", "(", ")", "(", "target", "*", "string", ")", "{", "target", "=", "new", "(", "string", ")", "\n", "p", ".", "StringVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// String parses the next command-line value as string.
[ "String", "parses", "the", "next", "command", "-", "line", "value", "as", "string", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L77-L81
26,059
alecthomas/kingpin
values_generated.go
Strings
func (p *parserMixin) Strings() (target *[]string) { target = new([]string) p.StringsVar(target) return }
go
func (p *parserMixin) Strings() (target *[]string) { target = new([]string) p.StringsVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Strings", "(", ")", "(", "target", "*", "[", "]", "string", ")", "{", "target", "=", "new", "(", "[", "]", "string", ")", "\n", "p", ".", "StringsVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Strings accumulates string values into a slice.
[ "Strings", "accumulates", "string", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L88-L92
26,060
alecthomas/kingpin
values_generated.go
Uint
func (p *parserMixin) Uint() (target *uint) { target = new(uint) p.UintVar(target) return }
go
func (p *parserMixin) Uint() (target *uint) { target = new(uint) p.UintVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint", "(", ")", "(", "target", "*", "uint", ")", "{", "target", "=", "new", "(", "uint", ")", "\n", "p", ".", "UintVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Uint parses the next command-line value as uint.
[ "Uint", "parses", "the", "next", "command", "-", "line", "value", "as", "uint", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L120-L124
26,061
alecthomas/kingpin
values_generated.go
Uints
func (p *parserMixin) Uints() (target *[]uint) { target = new([]uint) p.UintsVar(target) return }
go
func (p *parserMixin) Uints() (target *[]uint) { target = new([]uint) p.UintsVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uints", "(", ")", "(", "target", "*", "[", "]", "uint", ")", "{", "target", "=", "new", "(", "[", "]", "uint", ")", "\n", "p", ".", "UintsVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Uints accumulates uint values into a slice.
[ "Uints", "accumulates", "uint", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L131-L135
26,062
alecthomas/kingpin
values_generated.go
Uint8
func (p *parserMixin) Uint8() (target *uint8) { target = new(uint8) p.Uint8Var(target) return }
go
func (p *parserMixin) Uint8() (target *uint8) { target = new(uint8) p.Uint8Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint8", "(", ")", "(", "target", "*", "uint8", ")", "{", "target", "=", "new", "(", "uint8", ")", "\n", "p", ".", "Uint8Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Uint8 parses the next command-line value as uint8.
[ "Uint8", "parses", "the", "next", "command", "-", "line", "value", "as", "uint8", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L163-L167
26,063
alecthomas/kingpin
values_generated.go
Uint8List
func (p *parserMixin) Uint8List() (target *[]uint8) { target = new([]uint8) p.Uint8ListVar(target) return }
go
func (p *parserMixin) Uint8List() (target *[]uint8) { target = new([]uint8) p.Uint8ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint8List", "(", ")", "(", "target", "*", "[", "]", "uint8", ")", "{", "target", "=", "new", "(", "[", "]", "uint8", ")", "\n", "p", ".", "Uint8ListVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Uint8List accumulates uint8 values into a slice.
[ "Uint8List", "accumulates", "uint8", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L174-L178
26,064
alecthomas/kingpin
values_generated.go
Uint16
func (p *parserMixin) Uint16() (target *uint16) { target = new(uint16) p.Uint16Var(target) return }
go
func (p *parserMixin) Uint16() (target *uint16) { target = new(uint16) p.Uint16Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint16", "(", ")", "(", "target", "*", "uint16", ")", "{", "target", "=", "new", "(", "uint16", ")", "\n", "p", ".", "Uint16Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Uint16 parses the next command-line value as uint16.
[ "Uint16", "parses", "the", "next", "command", "-", "line", "value", "as", "uint16", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L206-L210
26,065
alecthomas/kingpin
values_generated.go
Uint16List
func (p *parserMixin) Uint16List() (target *[]uint16) { target = new([]uint16) p.Uint16ListVar(target) return }
go
func (p *parserMixin) Uint16List() (target *[]uint16) { target = new([]uint16) p.Uint16ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint16List", "(", ")", "(", "target", "*", "[", "]", "uint16", ")", "{", "target", "=", "new", "(", "[", "]", "uint16", ")", "\n", "p", ".", "Uint16ListVar", "(", "target", ")", "\n", "return", "\n", "}...
// Uint16List accumulates uint16 values into a slice.
[ "Uint16List", "accumulates", "uint16", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L217-L221
26,066
alecthomas/kingpin
values_generated.go
Uint32
func (p *parserMixin) Uint32() (target *uint32) { target = new(uint32) p.Uint32Var(target) return }
go
func (p *parserMixin) Uint32() (target *uint32) { target = new(uint32) p.Uint32Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint32", "(", ")", "(", "target", "*", "uint32", ")", "{", "target", "=", "new", "(", "uint32", ")", "\n", "p", ".", "Uint32Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Uint32 parses the next command-line value as uint32.
[ "Uint32", "parses", "the", "next", "command", "-", "line", "value", "as", "uint32", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L249-L253
26,067
alecthomas/kingpin
values_generated.go
Uint32List
func (p *parserMixin) Uint32List() (target *[]uint32) { target = new([]uint32) p.Uint32ListVar(target) return }
go
func (p *parserMixin) Uint32List() (target *[]uint32) { target = new([]uint32) p.Uint32ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint32List", "(", ")", "(", "target", "*", "[", "]", "uint32", ")", "{", "target", "=", "new", "(", "[", "]", "uint32", ")", "\n", "p", ".", "Uint32ListVar", "(", "target", ")", "\n", "return", "\n", "}...
// Uint32List accumulates uint32 values into a slice.
[ "Uint32List", "accumulates", "uint32", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L260-L264
26,068
alecthomas/kingpin
values_generated.go
Uint64
func (p *parserMixin) Uint64() (target *uint64) { target = new(uint64) p.Uint64Var(target) return }
go
func (p *parserMixin) Uint64() (target *uint64) { target = new(uint64) p.Uint64Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint64", "(", ")", "(", "target", "*", "uint64", ")", "{", "target", "=", "new", "(", "uint64", ")", "\n", "p", ".", "Uint64Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Uint64 parses the next command-line value as uint64.
[ "Uint64", "parses", "the", "next", "command", "-", "line", "value", "as", "uint64", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L292-L296
26,069
alecthomas/kingpin
values_generated.go
Uint64List
func (p *parserMixin) Uint64List() (target *[]uint64) { target = new([]uint64) p.Uint64ListVar(target) return }
go
func (p *parserMixin) Uint64List() (target *[]uint64) { target = new([]uint64) p.Uint64ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Uint64List", "(", ")", "(", "target", "*", "[", "]", "uint64", ")", "{", "target", "=", "new", "(", "[", "]", "uint64", ")", "\n", "p", ".", "Uint64ListVar", "(", "target", ")", "\n", "return", "\n", "}...
// Uint64List accumulates uint64 values into a slice.
[ "Uint64List", "accumulates", "uint64", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L303-L307
26,070
alecthomas/kingpin
values_generated.go
Int
func (p *parserMixin) Int() (target *int) { target = new(int) p.IntVar(target) return }
go
func (p *parserMixin) Int() (target *int) { target = new(int) p.IntVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int", "(", ")", "(", "target", "*", "int", ")", "{", "target", "=", "new", "(", "int", ")", "\n", "p", ".", "IntVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int parses the next command-line value as int.
[ "Int", "parses", "the", "next", "command", "-", "line", "value", "as", "int", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L335-L339
26,071
alecthomas/kingpin
values_generated.go
Ints
func (p *parserMixin) Ints() (target *[]int) { target = new([]int) p.IntsVar(target) return }
go
func (p *parserMixin) Ints() (target *[]int) { target = new([]int) p.IntsVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Ints", "(", ")", "(", "target", "*", "[", "]", "int", ")", "{", "target", "=", "new", "(", "[", "]", "int", ")", "\n", "p", ".", "IntsVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Ints accumulates int values into a slice.
[ "Ints", "accumulates", "int", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L346-L350
26,072
alecthomas/kingpin
values_generated.go
Int8
func (p *parserMixin) Int8() (target *int8) { target = new(int8) p.Int8Var(target) return }
go
func (p *parserMixin) Int8() (target *int8) { target = new(int8) p.Int8Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int8", "(", ")", "(", "target", "*", "int8", ")", "{", "target", "=", "new", "(", "int8", ")", "\n", "p", ".", "Int8Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int8 parses the next command-line value as int8.
[ "Int8", "parses", "the", "next", "command", "-", "line", "value", "as", "int8", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L378-L382
26,073
alecthomas/kingpin
values_generated.go
Int8List
func (p *parserMixin) Int8List() (target *[]int8) { target = new([]int8) p.Int8ListVar(target) return }
go
func (p *parserMixin) Int8List() (target *[]int8) { target = new([]int8) p.Int8ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int8List", "(", ")", "(", "target", "*", "[", "]", "int8", ")", "{", "target", "=", "new", "(", "[", "]", "int8", ")", "\n", "p", ".", "Int8ListVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int8List accumulates int8 values into a slice.
[ "Int8List", "accumulates", "int8", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L389-L393
26,074
alecthomas/kingpin
values_generated.go
Int16
func (p *parserMixin) Int16() (target *int16) { target = new(int16) p.Int16Var(target) return }
go
func (p *parserMixin) Int16() (target *int16) { target = new(int16) p.Int16Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int16", "(", ")", "(", "target", "*", "int16", ")", "{", "target", "=", "new", "(", "int16", ")", "\n", "p", ".", "Int16Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int16 parses the next command-line value as int16.
[ "Int16", "parses", "the", "next", "command", "-", "line", "value", "as", "int16", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L421-L425
26,075
alecthomas/kingpin
values_generated.go
Int16List
func (p *parserMixin) Int16List() (target *[]int16) { target = new([]int16) p.Int16ListVar(target) return }
go
func (p *parserMixin) Int16List() (target *[]int16) { target = new([]int16) p.Int16ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int16List", "(", ")", "(", "target", "*", "[", "]", "int16", ")", "{", "target", "=", "new", "(", "[", "]", "int16", ")", "\n", "p", ".", "Int16ListVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int16List accumulates int16 values into a slice.
[ "Int16List", "accumulates", "int16", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L432-L436
26,076
alecthomas/kingpin
values_generated.go
Int32
func (p *parserMixin) Int32() (target *int32) { target = new(int32) p.Int32Var(target) return }
go
func (p *parserMixin) Int32() (target *int32) { target = new(int32) p.Int32Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int32", "(", ")", "(", "target", "*", "int32", ")", "{", "target", "=", "new", "(", "int32", ")", "\n", "p", ".", "Int32Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int32 parses the next command-line value as int32.
[ "Int32", "parses", "the", "next", "command", "-", "line", "value", "as", "int32", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L464-L468
26,077
alecthomas/kingpin
values_generated.go
Int32List
func (p *parserMixin) Int32List() (target *[]int32) { target = new([]int32) p.Int32ListVar(target) return }
go
func (p *parserMixin) Int32List() (target *[]int32) { target = new([]int32) p.Int32ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int32List", "(", ")", "(", "target", "*", "[", "]", "int32", ")", "{", "target", "=", "new", "(", "[", "]", "int32", ")", "\n", "p", ".", "Int32ListVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int32List accumulates int32 values into a slice.
[ "Int32List", "accumulates", "int32", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L475-L479
26,078
alecthomas/kingpin
values_generated.go
Int64
func (p *parserMixin) Int64() (target *int64) { target = new(int64) p.Int64Var(target) return }
go
func (p *parserMixin) Int64() (target *int64) { target = new(int64) p.Int64Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int64", "(", ")", "(", "target", "*", "int64", ")", "{", "target", "=", "new", "(", "int64", ")", "\n", "p", ".", "Int64Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int64 parses the next command-line value as int64.
[ "Int64", "parses", "the", "next", "command", "-", "line", "value", "as", "int64", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L507-L511
26,079
alecthomas/kingpin
values_generated.go
Int64List
func (p *parserMixin) Int64List() (target *[]int64) { target = new([]int64) p.Int64ListVar(target) return }
go
func (p *parserMixin) Int64List() (target *[]int64) { target = new([]int64) p.Int64ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Int64List", "(", ")", "(", "target", "*", "[", "]", "int64", ")", "{", "target", "=", "new", "(", "[", "]", "int64", ")", "\n", "p", ".", "Int64ListVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Int64List accumulates int64 values into a slice.
[ "Int64List", "accumulates", "int64", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L518-L522
26,080
alecthomas/kingpin
values_generated.go
Float64
func (p *parserMixin) Float64() (target *float64) { target = new(float64) p.Float64Var(target) return }
go
func (p *parserMixin) Float64() (target *float64) { target = new(float64) p.Float64Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Float64", "(", ")", "(", "target", "*", "float64", ")", "{", "target", "=", "new", "(", "float64", ")", "\n", "p", ".", "Float64Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Float64 parses the next command-line value as float64.
[ "Float64", "parses", "the", "next", "command", "-", "line", "value", "as", "float64", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L550-L554
26,081
alecthomas/kingpin
values_generated.go
Float64List
func (p *parserMixin) Float64List() (target *[]float64) { target = new([]float64) p.Float64ListVar(target) return }
go
func (p *parserMixin) Float64List() (target *[]float64) { target = new([]float64) p.Float64ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Float64List", "(", ")", "(", "target", "*", "[", "]", "float64", ")", "{", "target", "=", "new", "(", "[", "]", "float64", ")", "\n", "p", ".", "Float64ListVar", "(", "target", ")", "\n", "return", "\n", ...
// Float64List accumulates float64 values into a slice.
[ "Float64List", "accumulates", "float64", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L561-L565
26,082
alecthomas/kingpin
values_generated.go
Float32
func (p *parserMixin) Float32() (target *float32) { target = new(float32) p.Float32Var(target) return }
go
func (p *parserMixin) Float32() (target *float32) { target = new(float32) p.Float32Var(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Float32", "(", ")", "(", "target", "*", "float32", ")", "{", "target", "=", "new", "(", "float32", ")", "\n", "p", ".", "Float32Var", "(", "target", ")", "\n", "return", "\n", "}" ]
// Float32 parses the next command-line value as float32.
[ "Float32", "parses", "the", "next", "command", "-", "line", "value", "as", "float32", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L593-L597
26,083
alecthomas/kingpin
values_generated.go
Float32List
func (p *parserMixin) Float32List() (target *[]float32) { target = new([]float32) p.Float32ListVar(target) return }
go
func (p *parserMixin) Float32List() (target *[]float32) { target = new([]float32) p.Float32ListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "Float32List", "(", ")", "(", "target", "*", "[", "]", "float32", ")", "{", "target", "=", "new", "(", "[", "]", "float32", ")", "\n", "p", ".", "Float32ListVar", "(", "target", ")", "\n", "return", "\n", ...
// Float32List accumulates float32 values into a slice.
[ "Float32List", "accumulates", "float32", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L604-L608
26,084
alecthomas/kingpin
values_generated.go
DurationList
func (p *parserMixin) DurationList() (target *[]time.Duration) { target = new([]time.Duration) p.DurationListVar(target) return }
go
func (p *parserMixin) DurationList() (target *[]time.Duration) { target = new([]time.Duration) p.DurationListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "DurationList", "(", ")", "(", "target", "*", "[", "]", "time", ".", "Duration", ")", "{", "target", "=", "new", "(", "[", "]", "time", ".", "Duration", ")", "\n", "p", ".", "DurationListVar", "(", "target...
// DurationList accumulates time.Duration values into a slice.
[ "DurationList", "accumulates", "time", ".", "Duration", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L617-L621
26,085
alecthomas/kingpin
values_generated.go
IPList
func (p *parserMixin) IPList() (target *[]net.IP) { target = new([]net.IP) p.IPListVar(target) return }
go
func (p *parserMixin) IPList() (target *[]net.IP) { target = new([]net.IP) p.IPListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "IPList", "(", ")", "(", "target", "*", "[", "]", "net", ".", "IP", ")", "{", "target", "=", "new", "(", "[", "]", "net", ".", "IP", ")", "\n", "p", ".", "IPListVar", "(", "target", ")", "\n", "retur...
// IPList accumulates net.IP values into a slice.
[ "IPList", "accumulates", "net", ".", "IP", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L630-L634
26,086
alecthomas/kingpin
values_generated.go
ExistingFiles
func (p *parserMixin) ExistingFiles() (target *[]string) { target = new([]string) p.ExistingFilesVar(target) return }
go
func (p *parserMixin) ExistingFiles() (target *[]string) { target = new([]string) p.ExistingFilesVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ExistingFiles", "(", ")", "(", "target", "*", "[", "]", "string", ")", "{", "target", "=", "new", "(", "[", "]", "string", ")", "\n", "p", ".", "ExistingFilesVar", "(", "target", ")", "\n", "return", "\n"...
// ExistingFiles accumulates string values into a slice.
[ "ExistingFiles", "accumulates", "string", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L656-L660
26,087
alecthomas/kingpin
values_generated.go
ExistingDirs
func (p *parserMixin) ExistingDirs() (target *[]string) { target = new([]string) p.ExistingDirsVar(target) return }
go
func (p *parserMixin) ExistingDirs() (target *[]string) { target = new([]string) p.ExistingDirsVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ExistingDirs", "(", ")", "(", "target", "*", "[", "]", "string", ")", "{", "target", "=", "new", "(", "[", "]", "string", ")", "\n", "p", ".", "ExistingDirsVar", "(", "target", ")", "\n", "return", "\n", ...
// ExistingDirs accumulates string values into a slice.
[ "ExistingDirs", "accumulates", "string", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L669-L673
26,088
alecthomas/kingpin
values_generated.go
ExistingFilesOrDirs
func (p *parserMixin) ExistingFilesOrDirs() (target *[]string) { target = new([]string) p.ExistingFilesOrDirsVar(target) return }
go
func (p *parserMixin) ExistingFilesOrDirs() (target *[]string) { target = new([]string) p.ExistingFilesOrDirsVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ExistingFilesOrDirs", "(", ")", "(", "target", "*", "[", "]", "string", ")", "{", "target", "=", "new", "(", "[", "]", "string", ")", "\n", "p", ".", "ExistingFilesOrDirsVar", "(", "target", ")", "\n", "ret...
// ExistingFilesOrDirs accumulates string values into a slice.
[ "ExistingFilesOrDirs", "accumulates", "string", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L682-L686
26,089
alecthomas/kingpin
values_generated.go
ResolvedIP
func (p *parserMixin) ResolvedIP() (target *net.IP) { target = new(net.IP) p.ResolvedIPVar(target) return }
go
func (p *parserMixin) ResolvedIP() (target *net.IP) { target = new(net.IP) p.ResolvedIPVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ResolvedIP", "(", ")", "(", "target", "*", "net", ".", "IP", ")", "{", "target", "=", "new", "(", "net", ".", "IP", ")", "\n", "p", ".", "ResolvedIPVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Resolve a hostname or IP to an IP.
[ "Resolve", "a", "hostname", "or", "IP", "to", "an", "IP", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L757-L761
26,090
alecthomas/kingpin
values_generated.go
ResolvedIPList
func (p *parserMixin) ResolvedIPList() (target *[]net.IP) { target = new([]net.IP) p.ResolvedIPListVar(target) return }
go
func (p *parserMixin) ResolvedIPList() (target *[]net.IP) { target = new([]net.IP) p.ResolvedIPListVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "ResolvedIPList", "(", ")", "(", "target", "*", "[", "]", "net", ".", "IP", ")", "{", "target", "=", "new", "(", "[", "]", "net", ".", "IP", ")", "\n", "p", ".", "ResolvedIPListVar", "(", "target", ")", ...
// ResolvedIPList accumulates net.IP values into a slice.
[ "ResolvedIPList", "accumulates", "net", ".", "IP", "values", "into", "a", "slice", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L768-L772
26,091
alecthomas/kingpin
values_generated.go
HexBytes
func (p *parserMixin) HexBytes() (target *[]byte) { target = new([]byte) p.HexBytesVar(target) return }
go
func (p *parserMixin) HexBytes() (target *[]byte) { target = new([]byte) p.HexBytesVar(target) return }
[ "func", "(", "p", "*", "parserMixin", ")", "HexBytes", "(", ")", "(", "target", "*", "[", "]", "byte", ")", "{", "target", "=", "new", "(", "[", "]", "byte", ")", "\n", "p", ".", "HexBytesVar", "(", "target", ")", "\n", "return", "\n", "}" ]
// Bytes as a hex string.
[ "Bytes", "as", "a", "hex", "string", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/values_generated.go#L800-L804
26,092
alecthomas/kingpin
global.go
Parse
func Parse() string { selected := MustParse(CommandLine.Parse(os.Args[1:])) if selected == "" && CommandLine.cmdGroup.have() { Usage() CommandLine.terminate(0) } return selected }
go
func Parse() string { selected := MustParse(CommandLine.Parse(os.Args[1:])) if selected == "" && CommandLine.cmdGroup.have() { Usage() CommandLine.terminate(0) } return selected }
[ "func", "Parse", "(", ")", "string", "{", "selected", ":=", "MustParse", "(", "CommandLine", ".", "Parse", "(", "os", ".", "Args", "[", "1", ":", "]", ")", ")", "\n", "if", "selected", "==", "\"", "\"", "&&", "CommandLine", ".", "cmdGroup", ".", "h...
// Parse and return the selected command. Will call the termination handler if // an error is encountered.
[ "Parse", "and", "return", "the", "selected", "command", ".", "Will", "call", "the", "termination", "handler", "if", "an", "error", "is", "encountered", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/global.go#L38-L45
26,093
alecthomas/kingpin
global.go
FatalIfError
func FatalIfError(err error, format string, args ...interface{}) { CommandLine.FatalIfError(err, format, args...) }
go
func FatalIfError(err error, format string, args ...interface{}) { CommandLine.FatalIfError(err, format, args...) }
[ "func", "FatalIfError", "(", "err", "error", ",", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "CommandLine", ".", "FatalIfError", "(", "err", ",", "format", ",", "args", "...", ")", "\n", "}" ]
// FatalIfError prints an error and exits if err is not nil. The error is printed // with the given prefix.
[ "FatalIfError", "prints", "an", "error", "and", "exits", "if", "err", "is", "not", "nil", ".", "The", "error", "is", "printed", "with", "the", "given", "prefix", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/global.go#L59-L61
26,094
alecthomas/kingpin
global.go
FatalUsageContext
func FatalUsageContext(context *ParseContext, format string, args ...interface{}) { CommandLine.FatalUsageContext(context, format, args...) }
go
func FatalUsageContext(context *ParseContext, format string, args ...interface{}) { CommandLine.FatalUsageContext(context, format, args...) }
[ "func", "FatalUsageContext", "(", "context", "*", "ParseContext", ",", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "CommandLine", ".", "FatalUsageContext", "(", "context", ",", "format", ",", "args", "...", ")", "\n", "}" ]
// FatalUsageContext writes a printf formatted error message to stderr, then // usage information for the given ParseContext, before exiting.
[ "FatalUsageContext", "writes", "a", "printf", "formatted", "error", "message", "to", "stderr", "then", "usage", "information", "for", "the", "given", "ParseContext", "before", "exiting", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/global.go#L71-L73
26,095
alecthomas/kingpin
args.go
GetArg
func (a *argGroup) GetArg(name string) *ArgClause { for _, arg := range a.args { if arg.name == name { return arg } } return nil }
go
func (a *argGroup) GetArg(name string) *ArgClause { for _, arg := range a.args { if arg.name == name { return arg } } return nil }
[ "func", "(", "a", "*", "argGroup", ")", "GetArg", "(", "name", "string", ")", "*", "ArgClause", "{", "for", "_", ",", "arg", ":=", "range", "a", ".", "args", "{", "if", "arg", ".", "name", "==", "name", "{", "return", "arg", "\n", "}", "\n", "}...
// GetArg gets an argument definition. // // This allows existing arguments to be modified after definition but before parsing. Useful for // modular applications.
[ "GetArg", "gets", "an", "argument", "definition", ".", "This", "allows", "existing", "arguments", "to", "be", "modified", "after", "definition", "but", "before", "parsing", ".", "Useful", "for", "modular", "applications", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/args.go#L23-L30
26,096
alecthomas/kingpin
completions.go
addHintActionBuiltin
func (a *completionsMixin) addHintActionBuiltin(action HintAction) { a.builtinHintActions = append(a.builtinHintActions, action) }
go
func (a *completionsMixin) addHintActionBuiltin(action HintAction) { a.builtinHintActions = append(a.builtinHintActions, action) }
[ "func", "(", "a", "*", "completionsMixin", ")", "addHintActionBuiltin", "(", "action", "HintAction", ")", "{", "a", ".", "builtinHintActions", "=", "append", "(", "a", ".", "builtinHintActions", ",", "action", ")", "\n", "}" ]
// Allow adding of HintActions which are added internally, ie, EnumVar
[ "Allow", "adding", "of", "HintActions", "which", "are", "added", "internally", "ie", "EnumVar" ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/completions.go#L16-L18
26,097
alecthomas/kingpin
cmd.go
CmdCompletion
func (c *cmdMixin) CmdCompletion(context *ParseContext) []string { var options []string // Count args already satisfied - we won't complete those, and add any // default commands' alternatives, since they weren't listed explicitly // and the user may want to explicitly list something else. argsSatisfied := 0 all...
go
func (c *cmdMixin) CmdCompletion(context *ParseContext) []string { var options []string // Count args already satisfied - we won't complete those, and add any // default commands' alternatives, since they weren't listed explicitly // and the user may want to explicitly list something else. argsSatisfied := 0 all...
[ "func", "(", "c", "*", "cmdMixin", ")", "CmdCompletion", "(", "context", "*", "ParseContext", ")", "[", "]", "string", "{", "var", "options", "[", "]", "string", "\n\n", "// Count args already satisfied - we won't complete those, and add any", "// default commands' alte...
// CmdCompletion returns completion options for arguments, if that's where // parsing left off, or commands if there aren't any unsatisfied args.
[ "CmdCompletion", "returns", "completion", "options", "for", "arguments", "if", "that", "s", "where", "parsing", "left", "off", "or", "commands", "if", "there", "aren", "t", "any", "unsatisfied", "args", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/cmd.go#L17-L79
26,098
alecthomas/kingpin
cmd.go
Alias
func (c *CmdClause) Alias(name string) *CmdClause { c.aliases = append(c.aliases, name) return c }
go
func (c *CmdClause) Alias(name string) *CmdClause { c.aliases = append(c.aliases, name) return c }
[ "func", "(", "c", "*", "CmdClause", ")", "Alias", "(", "name", "string", ")", "*", "CmdClause", "{", "c", ".", "aliases", "=", "append", "(", "c", ".", "aliases", ",", "name", ")", "\n", "return", "c", "\n", "}" ]
// Add an Alias for this command.
[ "Add", "an", "Alias", "for", "this", "command", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/cmd.go#L243-L246
26,099
alecthomas/kingpin
cmd.go
Command
func (c *CmdClause) Command(name, help string) *CmdClause { cmd := c.addCommand(name, help) cmd.parent = c return cmd }
go
func (c *CmdClause) Command(name, help string) *CmdClause { cmd := c.addCommand(name, help) cmd.parent = c return cmd }
[ "func", "(", "c", "*", "CmdClause", ")", "Command", "(", "name", ",", "help", "string", ")", "*", "CmdClause", "{", "cmd", ":=", "c", ".", "addCommand", "(", "name", ",", "help", ")", "\n", "cmd", ".", "parent", "=", "c", "\n", "return", "cmd", "...
// Command adds a new sub-command.
[ "Command", "adds", "a", "new", "sub", "-", "command", "." ]
ef6e7c151c4fdbd3fe78aad001729fee08fa0932
https://github.com/alecthomas/kingpin/blob/ef6e7c151c4fdbd3fe78aad001729fee08fa0932/cmd.go#L263-L267