changeset 1544:3d5193b4c582

jp: separate password and connection of profile in --connect and --pwd arguments
author Goffi <goffi@goffi.org>
date Mon, 02 Nov 2015 22:02:41 +0100
parents 62596ec69bbd
children b8ee774c12c8
files frontends/src/jp/base.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/base.py	Mon Nov 02 22:02:37 2015 +0100
+++ b/frontends/src/jp/base.py	Mon Nov 02 22:02:41 2015 +0100
@@ -111,7 +111,8 @@
 
         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 @@
             # 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):