Commit 00bbf02d authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

enhance arguments checking by using min_args, and stop using deprecated pop_arg

parent 23c0a300231a
......@@ -9,8 +9,6 @@ __docformat__ = "restructuredtext en"
import sys
from cStringIO import StringIO
from logilab.common.clcommands import register_commands, pop_arg
from cubicweb.toolsutils import CONNECT_OPTIONS, Command, config_connect
from cubicweb.cwctl import CWCTL
......@@ -28,7 +26,8 @@ class MBOXImportCommand(Command):
path to a file using the Unix MBOX format. If "-" is given, stdin is read.
"""
name = 'mboximport'
arguments = '<pyro id> <mbox file>'
arguments = '<pyro id> <mbox file>...'
min_args = 2
options = CONNECT_OPTIONS + (
("interactive",
{'short': 'i', 'action' : 'store_true',
......@@ -39,7 +38,7 @@ class MBOXImportCommand(Command):
def run(self, args):
"""run the command with its specific arguments"""
appid = pop_arg(args, expected_size_after=None)
appid = args.pop()
cnx = config_connect(appid, self.config)
cnx.load_appobjects(cubes=None, subpath=('entities',))
importer = MBOXImporter(cnx, verbose=True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment