URI: 
       tallow client daemon to be launched in the foreground (fix #1873) - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit be15b76c9bd4d1e7a29a477f2c1205dd591a9e2a
   DIR parent f381aee83549a456a47f2d2a001f7215023a3117
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Sat,  7 Jan 2017 10:10:51 +0100
       
       allow client daemon to be launched in the foreground (fix #1873)
       
       Diffstat:
         M electrum                            |      13 +++++++------
         M lib/commands.py                     |       2 +-
         M lib/daemon.py                       |       4 ++--
       
       3 files changed, 10 insertions(+), 9 deletions(-)
       ---
   DIR diff --git a/electrum b/electrum
       t@@ -342,14 +342,15 @@ if __name__ == '__main__':
        
            elif cmdname == 'daemon':
                subcommand = config.get('subcommand')
       -        assert subcommand in ['start', 'stop', 'status']
       -        if subcommand == 'start':
       +        assert subcommand in [None, 'start', 'stop', 'status']
       +        if subcommand in [None, 'start']:
                    fd, server = daemon.get_fd_or_server(config)
                    if fd is not None:
       -                pid = os.fork()
       -                if pid:
       -                    print_stderr("starting daemon (PID %d)" % pid)
       -                    sys.exit(0)
       +                if subcommand == 'start':
       +                    pid = os.fork()
       +                    if pid:
       +                        print_stderr("starting daemon (PID %d)" % pid)
       +                        sys.exit(0)
                        init_plugins(config, 'cmdline')
                        d = daemon.Daemon(config, fd)
                        d.start()
   DIR diff --git a/lib/commands.py b/lib/commands.py
       t@@ -762,7 +762,7 @@ def get_parser():
            add_network_options(parser_gui)
            # daemon
            parser_daemon = subparsers.add_parser('daemon', parents=[parent_parser], help="Run Daemon")
       -    parser_daemon.add_argument("subcommand", choices=['start', 'status', 'stop'])
       +    parser_daemon.add_argument("subcommand", choices=['start', 'status', 'stop'], nargs='?')
            #parser_daemon.set_defaults(func=run_daemon)
            add_network_options(parser_daemon)
            # commands
   DIR diff --git a/lib/daemon.py b/lib/daemon.py
       t@@ -147,8 +147,8 @@ class Daemon(DaemonThread):
        
            def run_daemon(self, config):
                sub = config.get('subcommand')
       -        assert sub in ['start', 'stop', 'status']
       -        if sub == 'start':
       +        assert sub in [None, 'start', 'stop', 'status']
       +        if sub in [None, 'start']:
                    response = "Daemon already running"
                elif sub == 'status':
                    if self.network: