I couldn't find this question in the web UI... So responding via email...

I don't actually know why... But I think it might be because we have other
initialization that has to be done in `main` before the `flag`s are parsed.
On Mar 22, 2014 5:06 PM, "Riobard Zhan" <notifications@github.com> wrote:

> In config.go:
>
> > +	flag.UintVarP(&B2D.Memory, "memory", "m", 1024, "virtual machine memory size (in MB).")
> > +	flag.Uint16Var(&B2D.SSHPort, "sshport", 2022, "host SSH port (forward to port 22 in VM).")
> > +	flag.Uint16Var(&B2D.DockerPort, "dockerport", 4243, "host Docker port (forward to port 4243 in VM).")
> > +	flag.IPVar(&B2D.HostIP, "hostip", net.ParseIP("192.168.59.3"), "VirtualBox host-only network IP address.")
> > +	flag.IPMaskVar(&B2D.NetMask, "netmask", flag.ParseIPv4Mask("255.255.255.0"), "VirtualBox host-only network mask.")
> > +	flag.BoolVar(&B2D.DHCPEnabled, "dhcp", true, "enable VirtualBox host-only network DHCP.")
> > +	flag.IPVar(&B2D.DHCPIP, "dhcpip", net.ParseIP("192.168.59.99"), "VirtualBox host-only network DHCP server address.")
> > +	flag.IPVar(&B2D.LowerIP, "lowerip", net.ParseIP("192.168.59.103"), "VirtualBox host-only network DHCP lower bound.")
> > +	flag.IPVar(&B2D.UpperIP, "upperip", net.ParseIP("192.168.59.254"), "VirtualBox host-only network DHCP upper bound.")
> > +	flag.StringVar(&B2D.VM, "vm", "boot2docker-vm", "virtual machine name.")
> > +
> > +	flag.StringVarP(&B2D.Dir, "dir", "d", dir, "boot2docker config directory.")
> > +	flag.StringVar(&B2D.ISO, "iso", filepath.Join(dir, "boot2docker.iso"), "path to boot2docker ISO image.")
> > +
> > +	osArgs := os.Args // save original os.Args
> > +	// Insert profile args before command-line args so that command-line overrides profile.
>
> Is there any reason flag.Parse() is called in main() instead of in init()?
> The split seems really arbitrary to me at the moment, and I'd like to
> understand the rationale behind the choice. Thanks! :)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/boot2docker/boot2docker-cli/pull/70/files#r10864914>
> .
>