diff -r 440df442d705 -r 65f5e488f983 cwctl.py --- a/cwctl.py Fri Aug 20 17:08:08 2010 +0200 +++ b/cwctl.py Wed Aug 25 09:42:55 2010 +0200 @@ -37,12 +37,15 @@ from os.path import exists, join, isfile, isdir, dirname, abspath -from logilab.common.clcommands import register_commands, pop_arg +from logilab.common.clcommands import CommandLine from logilab.common.shellutils import ASK from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CWDEV, CONFIGURATIONS -from cubicweb.toolsutils import Command, main_run, rm, create_dir, underline_title +from cubicweb.toolsutils import Command, rm, create_dir, underline_title +from cubicweb.__pkginfo__ import version + +CWCTL = CommandLine('cubicweb-ctl', 'The CubicWeb swiss-knife.', version=version) def wait_process_end(pid, maxtry=10, waittime=1): """wait for a process to actually die""" @@ -301,6 +304,7 @@ """ name = 'create' arguments = ' ' + min_args = max_args = 2 options = ( ("config-level", {'short': 'l', 'type' : 'int', 'metavar': '', @@ -325,8 +329,8 @@ """run the command with its specific arguments""" from logilab.common.textutils import splitstrip configname = self.config.config - cubes = splitstrip(pop_arg(args, 1)) - appid = pop_arg(args) + appid, cubes = args + cubes = splitstrip(cubes) # get the configuration and helper config = cwcfg.config_for(appid, configname) config.set_language = False @@ -415,12 +419,12 @@ """ name = 'delete' arguments = '' - + min_args = max_args = 1 options = () def run(self, args): """run the command with its specific arguments""" - appid = pop_arg(args, msg="No instance specified !") + appid = args[0] configs = [cwcfg.config_for(appid, configname) for configname in cwcfg.possible_configurations(appid)] if not configs: @@ -796,6 +800,7 @@ """ name = 'shell' arguments = ' [batch command file(s)] [--