public static function parseArgs(array $args)
    {
        $result = [
            'name'   => null,
            'work'   => null,
            'weight' => 1,
            'backup' => false,
        ];
        foreach ($args as $arg) {
            //find work
            if (is_callable($arg)) {
                $result['work'] = $arg;
            }
            //find weight, backup, name
            if (is_string($arg) || is_numeric($arg)) {
                $arg = preg_replace('/\s+/', ' ', "$arg");
                $subArgs = explode(' ', trim($arg));
                foreach ($subArgs as $subArg) {
                    if (preg_match('/^[0-9]+$/', $subArg)) {
                        $result['weight'] = intval($subArg);
                    } elseif (preg_match('/(backup)/', strtolower($subArg))) {
                        $result['backup'] = true;
                    } else {
                        $result['name'] = $subArg;
                    }
                }
            }
        }

        return $result;
    }