Inheritance: ICommand
Example #1
0
 public ArgParser(string[] args, IFileSystem FileSystem)
 {
     if (FileSystem == null) { throw new ArgumentNullException("FileSystem can not be null"); };
     string configFileContents = FileSystem.ReadFile("default.json");
     if(String.IsNullOrEmpty(configFileContents)) {
         FileSystem.CreateFile("default.json",_defaultConfig);
         configFileContents = _defaultConfig;
     }
     ProjectConfig = Config.LoadConfig(configFileContents);
     if(args != null && !String.IsNullOrEmpty(args[0])) {
         Command = new NewProject(FileSystem) { Config=ProjectConfig, Name=args[0] };
     }
 }
Example #2
0
        public ArgParser(string[] args, IFileSystem FileSystem)
        {
            if (FileSystem == null)
            {
                throw new ArgumentNullException("FileSystem can not be null");
            }
            ;
            string configFileContents = FileSystem.ReadFile("default.json");

            if (String.IsNullOrEmpty(configFileContents))
            {
                FileSystem.CreateFile("default.json", _defaultConfig);
                configFileContents = _defaultConfig;
            }
            ProjectConfig = Config.LoadConfig(configFileContents);
            if (args != null && !String.IsNullOrEmpty(args[0]))
            {
                Command = new NewProject(FileSystem)
                {
                    Config = ProjectConfig, Name = args[0]
                };
            }
        }