Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 7.0% on proxy.golang.org
Top 4.6% dependent packages on proxy.golang.org

proxy.golang.org : github.com/xitonix/flags

Package flags is a POSIX/GNU compliant flags library providing a simple, yet fully flexible API to manage command line arguments. The value of each flag can be provided by different sources. Two built-in value providers are command line argument and environment variable sources, with the former at the beginning of the chain, meaning the values parsed by the command line argument source will override the environment variable values. The package also provides the API to register new custom sources to the chain with a desired priority. For example, you may have your own implementation of the Source interface to read from a YAML or JSON file. See AppendSource, PrependSource and AddSource functions for more details. The API is packed with a full set of standard built in flag types, from int to IP address and many more. But you can also build a flag for your custom type and ask the library to pass it through the processing pipeline, the same way it treats any pre-built flags. Usage The package uses the concept of Buckets to organise the flags. You may create a new bucket to register your flags, or go with the default bucket instead. Use a new bucket instance Use the default bucket The following command line argument formats are supported by the library: Boolean flags Numeric flags (Integers or floating point numbers) Non numeric flags

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/xitonix/flags
Keywords: cli, environment, flags, go, golang
License: Apache-2.0
Latest release: almost 5 years ago
First release: almost 5 years ago
Namespace: github.com/xitonix
Dependent packages: 1
Stars: 1 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 17 days ago

    Loading...
    Readme
    Loading...