public DroneEnv(DroneConfig config, DroneFlags flags) { if(config == null) throw new ArgumentNullException("config"); if(flags == null) throw new ArgumentNullException("flags"); this.Config = config; this.Flags = flags; }
private void InitCommand(ParameterTokenSet tokens, DroneFlags flags) { if (File.Exists(flags.ConfigFileName)) { this.log.Warn("file '{0}' already exists", flags.ConfigFileName); return; } var config = new DroneConfig(); config.SetConfigFilename(flags.ConfigFileName); this.droneService.InitDroneDir(config); this.droneService.SaveConfig(config); this.log.Info("created '{0}'", Path.GetFileName(config.DroneDirPath)); this.log.Info("created '{0}'", Path.GetFileName(config.FilePath)); }