You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: config.go
    path of file: ./repos/plik/client
    
    the code of the file until where you have to start completion: package main

import (
	"bytes"
	"fmt"
	"net/url"
	"os"
	"strconv"
	"strings"

	"github.com/BurntSushi/toml"
	"github.com/docopt/docopt-go"
	"github.com/mitchellh/go-homedir"

	"github.com/root-gg/plik/plik"
	"github.com/root-gg/plik/server/common"
)

// CliConfig object
type CliConfig struct {
	Debug          bool
	Quiet          bool
	URL            string
	OneShot        bool
	Removable      bool
	Stream         bool
	Secure         bool
	SecureMethod   string
	SecureOptions  map[string]interface{}
	Archive        bool
	ArchiveMethod  string
	ArchiveOptions map[string]interface{}
	DownloadBinary string
	Comments       string
	Login          string
	Password       string
	TTL            int
	ExtendTTL      bool
	AutoUpdate     bool
	Token          string
	DisableStdin   bool
	Insecure       bool

	filePaths        []string
	filenameOverride string
}

// NewUploadConfig construct a new configuration with default values
func NewUploadConfig() (config *CliConfig) {
	config = new(CliConfig)
	config.URL = "http://127.0.0.1:8080"
	config.ArchiveMethod = "tar"
	config.ArchiveOptions = make(map[string]interface{})
	config.ArchiveOptions["Tar"] = "/bin/tar"
	config.ArchiveOptions["Compress"] = "gzip"
	config.ArchiveOptions["Options"] = ""
	config.SecureMethod = "openssl"
	config.SecureOptions = make(map[string]interface{})
	config.SecureOptions["Ope
    
func (config *CliConfig) UnmarshalArgs(opts docopt.Opts) (err error) {
	if opts["--debug"].(bool) {
		config.Debug = true
	}
	if opts["--quiet"].(bool) {
		config.Quiet = true
	}

	// Plik server url
	if opts["--server"] != nil && opts["--server"].(string) != "" {
		config.URL = opts["--server"].(string)
	}

	// Paths
	if _, ok := opts["FILE"].([]string); ok {
		config.filePaths = opts["FILE"].([]string)
	} else {
		return fmt.Errorf("No files specified")
	}

	for _, path := range config.filePaths {
		// Test if file exists
		fileInfo, err := os.Stat(path)
		if err != nil {
			return fmt.Errorf("File %s not found", path)
		}

		// Automatically enable archive mode is at least one file is a directory
		if fileInfo.IsDir() {
			config.Archive = true
		}
	}

	// Override file name if specified
	if opts["--name"] != nil && opts["--name"].(string) != "" {
		config.filenameOverride = opts["--name"].(string)
	}

	// Upload options
	if opts["--oneshot"].(bool) {
		config.OneShot = true
	}
	if opts["--removable"].(bool) {
		config.Removable = true
	}

	if opts["--stream"].(bool) {
		config.Stream = true
	}

	if opts["--comments"] != nil && opts["--comments"].(string) != "" {
		config.Comments = opts["--comments"].(string)
	}

	// Configure upload expire date
	if opts["--ttl"] != nil && opts["--ttl"].(string) != "" {
		ttlStr := opts["--ttl"].(string)
		mul := 1
		if string(ttlStr[len(ttlStr)-1]) == "m" {
			mul = 60
		} else if string(ttlStr[len(ttlStr)-1]) == "h" {
			mul = 3600
		} else if string(ttlStr[len(ttlStr)-1]) == "d" {
			mul = 86400
		}
		if mul != 1 {
			ttlStr = ttlStr[:len(ttlStr)-1]
		}
		ttl, err := strconv.Atoi(ttlStr)
		if err != nil {
			return fmt.Errorf("Invalid TTL %s", opts["--ttl"].(string))
		}
		config.TTL = ttl * mul
	}

	if opts["--extend-ttl"].(bool) {
		config.ExtendTTL = true
	}

	// Enable archive mode ?
	if opts["-a"].(bool) || opts["--archive"] != nil || config.Archive {
		config.Archive = true

		if opts["--archive"] != nil && opts["--archive"] != "" {
			config.ArchiveMethod = opts["--archive"].(string)
		}
	}

	// Enable secure mode ?
	if opts["--not-secure"].(bool) {
		config.Secure = false
	} else if opts["-s"].(bool) || opts["--secure"] != nil || config.Secure {
		config.Secure = true
		if opts["--secure"] != nil && opts["--secure"].(string) != "" {
			config.SecureMethod = opts["--secure"].(string)
		}
	}

	// Enable password protection ?
	if opts["-p"].(bool) {
		fmt.Printf("Login [plik]: ")
		var err error
		_, err = fmt.Scanln(&config.Login)
		if err != nil && err.Error() != "unexpected newline" {
			return fmt.Errorf("Unable to get login : %s", err)
		}
		if config.Login == "" {
			config.Login = "plik"
		}
		fmt.Printf("Password: ")
		_, err = fmt.Scanln(&config.Password)
		if err != nil {
			return fmt.Errorf("Unable to get password : %s", err)
		}
	} else if opts["--password"] != nil && opts["--password"].(string) != "" {
		credentials := opts["--password"].(string)
		sepIndex := strings.Index(credentials, ":")
		var login, password string
		if sepIndex > 0 {
			login = credentials[:sepIndex]
			password = credentials[sepIndex+1:]
		} else {
			login = "plik"
			password = credentials
		}
		config.Login = login
		config.Password = password
	}

	// Override upload token ?
	if opts["--token"] != nil && opts["--token"].(string) != "" {
		config.Token = opts["--token"].(string)
	}

	// Ask for token
	if config.Token == "-" {
		fmt.Printf("Token: ")
		var err error
		_, err = fmt.Scanln(&config.Token)
		if err != nil {
			return fmt.Errorf("Unable to get token : %s", err)
		}
	}

	if opts["--stdin"].(bool) {
		config.DisableStdin = false
	}

	return
}