Tags: peterbourgon/ff
Tags
Make partial success of FlagSet.Parse possible (#155) * Parse: mark as parsed, even on error * UnknownFlagError
v4-alpha.3 (#117) * bool flag changes * Major retooling * Add Rewrap * Rework testing and constructors * Improve run-action-tests
v4-alpha.2 (#114) * ffhelp: refactor default sections * Huge WIP * README: fixes and tweaks * FlagSetAny * Iteration * Fix for CI * Major continued refactoring * Minor updates * Improvements * WIP * WIP * WIP * ffenv: fix typo * ffjson, fftoml: fix the same typo * Comment cleanup
v4.0.0-alpha.1 (#113) * Initial commit of ff v4 (rebase 1) * Experiment: rename FlagSet to Flags * examples/objectctl: add a test case * Comment updates * Fix comment * Comment updates * examples/textctl: minor changes to var names * Minor renames to ParseContext fields * Tweaks * README updates * ffhelp: overhaul * Tweaks and renames * Minor tweak * ExampleParse_help * README updates * README updates * Comment updates * ffbasic + support * internal: ffdata * Cleanup * Comment fixes
JSON, TOML, YAML: support for nested config data (#112) * internal: add TraverseMap * gofumpt * JSONParseConfig * internal: TraverseMap: map[any]any * fftoml: don't break the API * internal: TraverseMap: test for map[any]any * fftest, ffyaml: nested node tests * Can't remove ParseError types * Can't remove StringConversionError type
ffcli.DefaultUsageFunc: Support flag help placeholders (#106) (This is an arguably uncontroversial part of the proposal in #105. Its's a new feature, not a significant change in behavior.) Currently, ffcli.DefaultUsageFunc prints "..." for any flag that does not have a default value specified. This produces less-than-effective help from DefaultUsageFunc. This change retains the behavior of printing the default value as-is, but if a default value is not provided, it allows users to provide placeholder text by wrapping a word inside the help text for a flag in backticks. For example, given the following: fset.String("c", "" /* default */, "path to `config` file") We'll get: -c config path to config file This matches the behavior of FlagSet.PrintDefaults, and indeed it relies on the same flag.UnquoteUsage machinery for this. This also has the nice side-effect of making a reasonable guess at an alternative placeholder text instead of "...". For example: fset.Int("n", "" /* default */, "number of items") // Before: -n ... number of items // Now: -n int number of items Note that as implemented right now, the user supplied placeholder will be used only if a non-zero default value was not supplied. This was an attempt to retain as much of the existing behavior. The proposal in #105, if you're open to it, would change more of the output.
Add a naïve parser for .env files (#89) * Add a naïve parser for .env files * Remove dead code * Cleanup
PreviousNext