added flag management
This commit is contained in:
parent
a9c57e76ba
commit
738fcfc34f
@ -42,7 +42,6 @@ path=/tmp
|
||||
## TODO
|
||||
|
||||
- tests
|
||||
- flag management
|
||||
|
||||
## License
|
||||
|
||||
@ -73,4 +72,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of this project.
|
||||
```
|
||||
```
|
||||
|
@ -21,14 +21,6 @@ func main() {
|
||||
|
||||
gi = new(getimaplib.GetImap)
|
||||
|
||||
if len(os.Args) > 1 {
|
||||
configfile = os.Args[1]
|
||||
} else {
|
||||
utils.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
utils.HandleFatalError(err)
|
||||
|
||||
mainconfig := config.GetConfig(configfile)
|
||||
gi.Config = mainconfig
|
||||
|
||||
|
@ -11,6 +11,7 @@ import (
|
||||
// GetConfig fetch the configuration from ini file
|
||||
func GetConfig(configfile string) *Config {
|
||||
flag.Usage = utils.Usage
|
||||
flag.StringVar(&configfile, "configfile", "getimap.ini", "config file to use with getimap section")
|
||||
flag.Parse()
|
||||
|
||||
cfg, err := ini.Load(configfile)
|
||||
|
Loading…
Reference in New Issue
Block a user