server/serverctl.py
changeset 7040 9b1f9bc74f5d
parent 6948 013f81b729de
parent 7036 63386b35ec69
child 7061 bb2080547722
--- a/server/serverctl.py	Fri Feb 18 17:11:45 2011 +0100
+++ b/server/serverctl.py	Mon Mar 07 17:02:15 2011 +0100
@@ -388,6 +388,10 @@
           'default': False,
           'help': 'insert drop statements to remove previously existant \
 tables, indexes... (no by default)'}),
+        ('config-level',
+         {'short': 'l', 'type': 'int', 'default': 1,
+          'help': 'level threshold for questions asked when configuring another source'
+          }),
         )
 
     def run(self, args):
@@ -412,7 +416,7 @@
                 % (config.sources_file(), str(ex).strip()))
         init_repository(config, drop=self.config.drop)
         while ASK.confirm('Enter another source ?', default_is_yes=False):
-            CWCTL.run(['add-source', config.appid])
+            CWCTL.run(['add-source', '--config-level', self.config.config_level, config.appid])
 
 
 class AddSourceCommand(Command):
@@ -424,7 +428,12 @@
     name = 'add-source'
     arguments = '<instance>'
     min_args = max_args = 1
-    options = ()
+    options = (
+        ('config-level',
+         {'short': 'l', 'type': 'int', 'default': 1,
+          'help': 'level threshold for questions asked when configuring another source'
+          }),
+        )
 
     def run(self, args):
         appid = args[0]
@@ -463,7 +472,7 @@
                 else:
                     break
         # XXX configurable inputlevel
-        sconfig = ask_source_config(config, type, inputlevel=0)
+        sconfig = ask_source_config(config, type, inputlevel=self.config.config_level)
         cfgstr = unicode(generate_source_config(sconfig), sys.stdin.encoding)
         req.create_entity('CWSource', name=sourceuri,
                           type=unicode(type), config=cfgstr)
@@ -840,9 +849,12 @@
     options = (
         ('checks',
          {'short': 'c', 'type' : 'csv', 'metavar' : '<check list>',
-          'default' : ('entities', 'relations', 'metadata', 'schema', 'text_index'),
+          'default' : ('entities', 'relations',
+                       'mandatory_relations', 'mandatory_attributes',
+                       'metadata', 'schema', 'text_index'),
           'help': 'Comma separated list of check to run. By default run all \
-checks, i.e. entities, relations, text_index and metadata.'}
+checks, i.e. entities, relations, mandatory_relations, mandatory_attributes, \
+metadata, text_index and schema.'}
          ),
 
         ('autofix',