An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: github.com/opencoff/pflag

Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the GNU extensions to the POSIX recommendations for command-line options. See http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html Usage: pflag is a drop-in replacement of Go's native flag package. If you import pflag under the name "flag" then all code should continue to function with no changes. There is one exception to this: if you directly instantiate the Flag struct there is one more field "Shorthand" that you will need to set. Most code never instantiates this struct directly, and instead uses functions such as String(), BoolVar(), and Var(), and is therefore unaffected. Define flags using flag.String(), Bool(), Int(), etc. This declares an integer flag, -flagname, stored in the pointer ip, with type *int. If you like, you can bind the flag to a variable using the Var() functions. Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by For such flags, the default value is just the initial value of the variable. After all flags are defined, call to parse the command line into the defined flags. Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. After parsing, the arguments after the flag are available as the slice flag.Args() or individually as flag.Arg(i). The arguments are indexed from 0 through flag.NArg()-1. The pflag package also defines some new functions that are not in flag, that give one-letter shorthands for flags. You can use these by appending 'P' to the name of any function that defines a flag. Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. Command line flag syntax: Unlike the flag package, a single dash before an option means something different than a double dash. Single dashes signify a series of shorthand letters for flags. All but the last shorthand letter must be boolean flags. Flag parsing stops after the terminator "--". Unlike the flag package, flags can be interspersed with arguments anywhere on the command line before this terminator. Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags (in their long form) accept 1, 0, t, f, true, false, TRUE, FALSE, True, False. Duration flags accept any input valid for time.ParseDuration. The default set of command-line flags is controlled by top-level functions. The FlagSet type allows one to define independent sets of flags, such as to implement subcommands in a command-line interface. The methods of FlagSet are analogous to the top-level functions for the command-line flag set.
19 versions
Latest release: almost 2 years ago
15 dependent packages

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/opencoff/pflag

View more repository details: http://repos.ecosyste.ms/hosts/GitHub/repositories/opencoff%2Fpflag

Dependent Repos 12

opencoff/go-proxies
SOCKSv5 and HTTP Proxy Server in golang

Size: 134 KB - Last synced: 10 days ago - Pushed: almost 5 years ago

opencoff/unbound-adblock
Generate ad-serving and malware list for unbound

Size: 79.1 KB - Last synced: 10 days ago - Pushed: 3 months ago

opencoff/sigtool
Ed25519 signing, verification and encryption, decryption for arbitary files; like OpenBSD signifiy but with more functionality and written in Golang - only easier and simpler

Size: 1.24 MB - Last synced: 2 days ago - Pushed: 2 days ago

opencoff/go-bbhash 📦
Fast Scalable Minimal Perfect Hash for Large Keysets

Size: 62.5 KB - Last synced: about 1 month ago - Pushed: 3 months ago

opencoff/go-nc
Netcat in golang

Size: 12.7 KB - Last synced: about 1 month ago - Pushed: almost 6 years ago

opencoff/go-tunnel
TLS/SSL Tunnel - A modern STunnel replacement written in golang

Size: 313 KB - Last synced: 7 days ago - Pushed: 7 days ago

opencoff/go-chd
Minimal Perfect Hash function via Compress Hash Displace

Size: 52.7 KB - Last synced: about 2 months ago - Pushed: about 4 years ago

opencoff/ovpn-tool
OpenVPN PKI tools and client/server configuration generator - better than easy-rsa

Size: 103 KB - Last synced: 2 days ago - Pushed: 2 days ago

pinklite/go-tunnel
The project is based on a sense of proxy that enables additional network-encryption.

Size: 323 KB - Last synced: over 2 years ago

opencoff/certik
opinionated TLS client & server PKI management tool

Size: 44.9 KB - Last synced: 2 days ago - Pushed: 2 days ago

opencoff/ifchange-ddns
Monitor network interface for IP address changes and update DDNS

Size: 40 KB - Last synced: 2 days ago - Pushed: 2 days ago

nomuq/ovpn

Size: 14.6 KB - Last synced: about 1 year ago - Pushed: over 3 years ago

ducksify/go-tunnel Fork of opencoff/go-tunnel
TLS/SSL Tunnel - A modern STunnel replacement written in golang

Size: 270 KB - Last synced: 8 months ago - Pushed: 8 months ago

isgasho/go-bbhash Fork of opencoff/go-bbhash
Fast Scalable Minimal Perfect Hash for Large Keysets

Size: 58.6 KB - Last synced: over 1 year ago - Pushed: about 5 years ago

JayaSanda/go-tunnel Fork of opencoff/go-tunnel
TLS/SSL Tunnel - A modern STunnel replacement written in golang

Size: 273 KB - Last synced: over 1 year ago - Pushed: about 2 years ago

Bebooo43/go-tunnel Fork of opencoff/go-tunnel
TLS/SSL Tunnel - A modern STunnel replacement written in golang

Size: 258 KB - Last synced: over 1 year ago - Pushed: over 4 years ago

opencoff/go-du 📦
Parallel du(1) to calculate disk utilization

Size: 53.7 KB - Last synced: 10 months ago - Pushed: 10 months ago

opencoff/go-hash
Cryptographic hash calculation & verification for files/dirs

Size: 69.3 KB - Last synced: about 2 months ago - Pushed: 10 months ago

racin/phd
Code and artifacts from PhD

Size: 1.19 MB - Last synced: about 2 months ago - Pushed: about 2 years ago

opencoff/go-progs
useful golang utilities for Unixish environments

Size: 51.8 KB - Last synced: 10 days ago - Pushed: about 2 months ago

opencoff/latmon
Ping latency plotter

Size: 125 KB - Last synced: 2 days ago - Pushed: 2 days ago

opencoff/go-clone
concurrent directory compare and clone utility

Size: 67.4 KB - Last synced: 2 days ago - Pushed: 2 days ago