Exemple #1
0
        public ParametersModel Parse(string[] args)
        {
            var p = new ParametersModel();
              var options = new Mono.Options.OptionSet();

              options.Add("h|help", "prints the help", s => p.Action = ActionType.WriteDescription);
              options.Add("v|vault=", "use the specified vault", s => p.Vault = s);
              options.Add("u|user="******"use the specified user", s => p.User = s);
              options.Add("s|server=", "use the specified server", s => p.Server = s);
              options.Add("p|password="******"use the specified password", s => p.Password = s);
              options.Add("destroy-by-class=", "destroy objects of the following classes, use Comma ',' as a separator for multiple classes",
            s => {
              p.Action = ActionType.DestroyObjectsOfClasses;
              p.DestroyObjectOfClasses = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            });
              options.Add("destroy-by-objecttype=", "destroy objects of the specified object types, use Comma ',' as a separator for multiple classes",
            s =>
            {
              p.Action = ActionType.DestroyObjectsOfObjectTypes;
              p.DestroyObjectsOfObjectTypes = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            });
              options.Add("lc|list-classes", "list all classes and their object counts", s => p.Action = ActionType.ListClassesAndObjects);
              options.Add("lo|list-objecttypes", "list all object types and their object counts", s => p.Action = ActionType.ListObjectTypesAndObjects);

              options.Parse(args);
              p.Options = options;
              return p;
        }
Exemple #2
0
 private Vault CreateVault(ParametersModel parameters)
 {
     string user = parameters.User;
       string password = parameters.Password;
       string vault = parameters.Vault;
       string networkAddress = parameters.Server;
       return CreateVault(user, password, vault, networkAddress);
 }