cmdr v1.5.0 Release Notes

Release Date: 2019-10-04 // over 4 years ago
    • 💅 Since v1.5.0, main entry Exec() uses With Functional Options style too:

    Expand to source codes

      err := cmdr.Exec(rootCmd,
            cmdr.WithXrefBuildingHooks(func(root *cmdr.RootCommand, args []string) {}, func(root *cmdr.RootCommand, args []string) {}),
            cmdr.WithAutomaticEnvHooks(func(root *cmdr.RootCommand, opts *cmdr.Options) {}),
            cmdr.WithEnvPrefix("CMDR"), // WithEnvPrefix("F","YY") == T_YY_xxx
            cmdr.WithOptionsPrefix("app"), // cmdr.WithRxxtPrefix("app"),
            cmdr.WithPredefinedLocations(nil),
            cmdr.WithIgnoreWrongEnumValue(true),
            cmdr.WithBuiltinCommands(true, true, true, true, true),
            cmdr.WithInternalOutputStreams(nil, nil),
            cmdr.WithCustomShowVersion(func() {}),
            cmdr.WithCustomShowBuildInfo(func() {}),
            cmdr.WithNoLoadConfigFiles(false),
            cmdr.WithHelpPainter(nil),
            cmdr.WithConfigLoadedListener(nil),
            cmdr.WithHelpTabStop(70),
            cmdr.WithUnknownOptionHandler(func(isFlag bool, title string, cmd *cmdr.Command, args []string) (fallbackToDefaultDetector bool) {
                    return true
            }), // since v1.5.5
            cmdr.WithSimilarThreshold(0.73), // since v1.5.5
            cmdr.WithNoColor(true), // since v1.6.2
            cmdr.WithNoEnvOverrides(true), // since v1.6.2
            cmdr.WithStrictMode(true), // since v1.6.2
        )