<commit_before>/*
   Copyright (C) 2017 <NAME> (<EMAIL>)
   Project       Syncimap
   Description   A rsync like IMAP syncronization tool
   License       Apache License 2.0 (see LICENSE for details)
*/

package main

import (
	"fmt"
	"gopkg.in/alecthomas/kingpin.v2"
	"net/url"
)

var (
	src = kingpin.Arg("source", "Set source URI").Required().String()
	dst = kingpin.Arg("destination", "Set destination URI").Required().String()
)

func main() {
	var srcurl, dsturl *url.URL
	var err error

	kingpin.CommandLine.HelpFlag.Short('h')
	kingpin.Parse()

	srcurl, err = url.Parse(*src)
	if err != nil {
		fmt.Errorf("Source URI is not valid")
	}

	dsturl, err = url.Parse(*dst)
	if err != nil {
		fmt.Errorf("Destination URI is not valid")
	}
}<commit_msg>Used struct for values from command line arguments<commit_after>/*
   Copyright (C) 2017 <NAME> (<EMAIL>)
   Project       Syncimap
   Description   A rsync like IMAP syncronization tool
   License       Apache License 2.0 (see LICENSE for details)
*/

package main

import (
	"fmt"
	"gopkg.in/alecthomas/kingpin.v2"
	"net/url"
)

type Data struct {
	Source      *string
	Destination *string
}

func parse(data *Data) {
	data.Source = kingpin.Arg("source", "Set source URI").Required().String()
	data.Destination = kingpin.Arg("destination", "Set destination URI").Required().String()
}

func main() {
	var data Data
	var srcurl, dsturl *url.URL
	var err error

	parse(&data)

	kingpin.CommandLine.HelpFlag.Short('h')
	kingpin.Parse()

	srcurl, err = url.Parse(*data.Source)
	if err != nil {
		fmt.Errorf("Source URI is not valid")
	}

	dsturl, err = url.Parse(*data.Destination)
	if err != nil {
		fmt.Errorf("Destination URI is not valid")
	}
}
{'fraction_non_alphanumeric': 0.1376470588235294, 'fraction_numerical': 0.00823529411764706, 'mean_word_length': 3.6475409836065573, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3178187', 'n_tokens_mistral': 615, 'n_tokens_neox': 589, 'n_words': 166}