DefaultOptions returns a new [Options] value with standard default values, based on the given app name and optional app about info.
(name string, about ...string)
| 57 | // with standard default values, based on the given |
| 58 | // app name and optional app about info. |
| 59 | func DefaultOptions(name string, about ...string) *Options { |
| 60 | abt := "" |
| 61 | if len(about) > 0 { |
| 62 | abt = about[0] |
| 63 | } |
| 64 | return &Options{ |
| 65 | AppName: name, |
| 66 | AppAbout: abt, |
| 67 | Fatal: true, |
| 68 | PrintSuccess: true, |
| 69 | DefaultEncoding: "toml", |
| 70 | DefaultFiles: []string{strcase.ToKebab(name) + ".toml"}, |
| 71 | IncludePaths: []string{".", "configs"}, |
| 72 | } |
| 73 | } |