Ecosyste.ms: Packages

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

Top 7.2% dependent packages on hackage.haskell.org
Top 4.8% dependent repos on hackage.haskell.org

hackage.haskell.org : hflags

The HFlags library supports easy definition of command line flags, reimplementing the ideas from Google's gflags (http://code.google.com/p/gflags). Command line flags can be declared in any file at the toplevel, using defineFlag. At runtime, the actual values are assigned to the toplevel flags_name constants. Those can be used purely throughout the program. At the beginning of the main function, $initHFlags "program description" has to be called to initialize the flags. All flags will be initialized that are transitively reachable via imports from main. This means, that any Haskell package can easily define command line flags with HFlags. This feature is demonstrated by http://github.com/errge/hflags/blob/master/examples/ImportExample.hs and http://github.com/errge/hflags/tree/master/examples/package. A simple example (more in the http://github.com/errge/hflags/tree/master/examples directory): At initHFlags time, the library also tries to gather flags out of environment variables. HFLAGS_verbose=True is equivalent to specify --verbose=True. This environment feature only works with long options and the user has to specify a value even for Bools. Since version 0.2, you mustn't put the initHFlags in a parentheses with the program description. Just $initHFlags, it's cleaner. See http://github.com/errge/hflags/tree/master/changelog for recent changes.

Registry - Source - Homepage - JSON
purl: pkg:hackage/hflags
Keywords: apache, console, library
License: Apache-2.0
Latest release: over 6 years ago
First release: about 12 years ago
Dependent packages: 2
Dependent repositories: 131
Downloads: 10,647 total
Stars: 12 on GitHub
Forks: 8 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 20 days ago

    Loading...
    Readme
    Loading...