Beispiel #1
0
// Deletes a flag from config file and persists the changes
// to the disk.
func (g *GlobalConf) Delete(flagSetName, flagName string) error {
	g.dict.Delete(flagSetName, flagName)
	if g.Filename != "" {
		return ini.Write(g.Filename, g.dict)
	}
	return nil
}
Beispiel #2
0
// Sets a flag's value and persists the changes to the disk.
func (g *GlobalConf) Set(flagSetName string, f *flag.Flag) error {
	g.dict.SetString(flagSetName, f.Name, f.Value.String())
	if g.Filename != "" {
		return ini.Write(g.Filename, g.dict)
	}
	return nil
}