# Path: ss/settings.py
# class Settings(object):
#     DEFAULT_TIMEOUT = 300
#     _LOCK = RLock()
#     def __init__(self):
#     def __getitem__(self, name):
#     def __setitem__(self, name, val):
#     def get(self, name, default=None):
#     def __contains__(self, name):
#     def update(self, config):
#     def dict(self):
#     def __repr__(self):


import platform
import argparse
import logging
import sys
import os
import json
        import re
from ss.settings import settings
        from multiprocessing import cpu_count
        return argv

    def parse(self, args=None):
        if not args:
            args = sys.argv[1:]
        cfg = self._cfg_param(args)
        d = lambda p: p.__dict__
        if args and cfg:
            subc = args[0]
            config = self._check_config(cfg)
            args = self.gen_argv(subc, config)
        return d(self.parser.parse_args(args))

def check_fork(v):
    if not hasattr(os, "fork") and v:
        logging.warn("optional parameter --fork only work on unix system")
        v = False
    return v

def parse_cli(args=None):
    
    cmd = Command()
    cfg = cmd.parse(args)
    if "rhost" in cfg:
        cfg["server"], cfg["server_port"] =  cfg["rhost"]
        del cfg["rhost"]

    settings.update(cfg)
    settings["fork"] = check_fork(settings.get("fork", False))


# Path: ss/settings.py
# class Settings(object):
#     DEFAULT_TIMEOUT = 300
#     _LOCK = RLock()
#     def __init__(self):
#     def __getitem__(self, name):
#     def __setitem__(self, name, val):
#     def get(self, name, default=None):
#     def __contains__(self, name):
#     def update(self, config):
#     def dict(self):
#     def __repr__(self):


# Path: ss/cli.py
import platform
import argparse
import logging
import sys
import os
import json
        import re
from ss.settings import settings
        from multiprocessing import cpu_count

        return argv

    def parse(self, args=None):
        if not args:
            args = sys.argv[1:]
        cfg = self._cfg_param(args)
        d = lambda p: p.__dict__
        if args and cfg:
            subc = args[0]
            config = self._check_config(cfg)
            args = self.gen_argv(subc, config)
        return d(self.parser.parse_args(args))

def check_fork(v):
    if not hasattr(os, "fork") and v:
        logging.warn("optional parameter --fork only work on unix system")
        v = False
    return v

def parse_cli(args=None):
    
    cmd = Command()
    cfg = cmd.parse(args)
    if "rhost" in cfg:
        cfg["server"], cfg["server_port"] =  cfg["rhost"]
        del cfg["rhost"]

    settings.update(cfg)
    settings["fork"] = check_fork(settings.get("fork", False))


    if settings["fork"] and not settings["log_file"]: