From 810a40c51c6a410f2646d16e3d60baf237fa74c9 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 2 Nov 2015 22:02:41 +0100 Subject: [PATCH] jp: separate password and connection of profile in --connect and --pwd arguments --- frontends/src/jp/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontends/src/jp/base.py b/frontends/src/jp/base.py index 749af283..ceedde47 100644 --- a/frontends/src/jp/base.py +++ b/frontends/src/jp/base.py @@ -111,7 +111,8 @@ class Jp(object): profile_parent = self.parents['profile'] = argparse.ArgumentParser(add_help=False) profile_parent.add_argument("-p", "--profile", action="store", type=str, default='@DEFAULT@', help=_("Use PROFILE profile key (default: %(default)s)")) - profile_parent.add_argument("-c", "--connect", action="store", type=str, nargs='?', const='', default=None, metavar='PASSWORD', help=_("Connect the profile before doing anything else")) + profile_parent.add_argument("--pwd", action="store", type=unicode, default='', metavar='PASSWORD', help=_("Password used to connect profile, if necessary")) + profile_parent.add_argument("-c", "--connect", action="store_true", help=_("Connect the profile before doing anything else")) progress_parent = self.parents['progress'] = argparse.ArgumentParser(add_help=False) if progressbar: @@ -243,7 +244,7 @@ class Jp(object): # a profile can be presente without connect option (e.g. on profile creation/deletion) return elif self.args.connect is not None: # if connection is asked, we connect the profile - self.bridge.asyncConnect(self.profile, self.args.connect, lambda dummy: callback(), cant_connect) + self.bridge.asyncConnect(self.profile, self.args.pwd, lambda dummy: callback(), cant_connect) self._auto_loop = True return elif not self.bridge.isConnected(self.profile):