<commit_before>package main

import (
	"flag"
	"log"
	"os"
)

func main() {
    unln := flag.Bool("u", false, "Unlinks the specified destination path")

    flag.Parse()

    // receives arguments from command line
	args := flag.Args()


    if *unln { // if -u flag was provided, do unlink destination
        // check if there is exactly one arguments (destination of hard link)
        if len(args) != 1 {
            log.Println(args)
            log.Fatal("Link script must receive exactly one argument when unlinking: destination")
        }

        dst := args[0] // destination

        // make a direct call to the syscall of current OS
        if err := os.Remove(dst); err != nil {
            // if there is an error, prints error message and exits
            log.Println("An error occurred while trying to remove specified link")
            log.Fatal(err)
        }

        log.Println("Successfully removed specified link")
    } else { // otherwise, do link source to destination
        // check if there are exactly two arguments (source and destination of hard link)
        if len(args) != 2 {
            log.Println(args)
            log.Fatal("Link script must receive exactly two arguments when linking: source and destination")
        }

        src := args[0] // source
        dst := args[1] // destination

        // make a direct call to the syscall of current OS
        if err := os.Link(src, dst); err != nil {
            // if there is an error, prints error message and exits
            log.Println("An error occurred while trying to create specified link")<commit_msg>Added explicit warning about link removal effects<commit_after>package main

import (
	"flag"
    "fmt"
	"log"
	"os"
)

func main() {
    unln := flag.Bool("u", false, "Unlinks the specified destination path")

    flag.Parse()

    // receives arguments from command line
	args := flag.Args()


    if *unln { // if -u flag was provided, do unlink destination
        // check if there is exactly one arguments (destination of hard link)
        if len(args) != 1 {
            log.Println(args)
            log.Fatal("Link script must receive exactly one argument when unlinking: destination")
        }

        dst := args[0] // destination

        yn := "n"
        fmt.Println("WARNING: removing hard link does delete all structure on destination. Confirm removal? [y|n]")
        fmt.Scanf("%s", &yn)

        if yn == "y"{ // removal confirmed: proceed with removal
            log.Println("Removal confirmed. Hard link will be removed")
            // make a direct call to the syscall of current OS
            if err := os.Remove(dst); err != nil {
                // if there is an error, prints error message and exits
                log.Println("An error occurred while trying to remove specified link")
                log.Fatal(err)
            }

            log.Println("Successfully removed specified link")
        } else { // removal cancelled
            log.Println("Removal cancelled. Nothing done")
        }

    } else { // otherwise, do link source to destination
        // check if there are exactly two arguments (source and destination of hard link)
        if len(args) != 2 {
            log.Println(args)
            log.Fatal("Link script must receive exactly two arguments when linking: source and destination")
        }

        src := args[0] // source
        dst := args[1] // destination

        // make a direct call to the syscall of current OS
        if err := os.Link(src, dst); err != nil {
            // if there is an error, prints error message and exits
            log.Println("An error occurred while trying to create specified link")
{'fraction_non_alphanumeric': 0.0945179584120983, 'fraction_numerical': 0.0027005130974885228, 'mean_word_length': 2.0892410341951626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6824146', 'n_tokens_mistral': 975, 'n_tokens_neox': 924, 'n_words': 401}