<commit_before>// Copyright 2013-2017 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// modprobe - Add and remove modules from the Linux Kernel
//
// Synopsis:
//     modprobe [-n] modulename [parameters...]
//     modprobe [-n] -a modulename...
//
// Author:
//     <NAME> <<EMAIL>>
package main

import (
	"flag"
	"log"
	"os"
	"strings"

	"github.com/u-root/u-root/pkg/kmodule"
)

const cmd = "modprobe [-an] modulename[s] [parameters...]"

var (
	dryRun     = flag.Bool("n", false, "Dry run")
	all        = flag.Bool("a", false, "Insert all module names on the command line.")
	verboseAll = flag.Bool("va", false, "Insert all module names on the command line.")
)

func init() {
	defUsage := flag.Usage
	flag.Usage = func() {
		os.Args[0] = cmd
		defUsage()
	}
}

func main() {
	flag.Parse()

	if flag.NArg() == 0 {
		log.Println("Usage: ERROR: one module and optional module options.")
		flag.Usage()
		os.Exit(1)
	}

	opts := kmodule.ProbeOpts{}
	if *dryRun {
		log.Println("Unique dependencies in load order, already loaded ones get skipped:")
		opts.DryRunCB = func(modPath string) {
			log.Println(modPath)
		}<commit_msg>cmds/modprobe: add -d <module_root_dir> parameter<commit_after>// Copyright 2013-2017 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// modprobe - Add and remove modules from the Linux Kernel
//
// Synopsis:
//     modprobe [-n] modulename [parameters...]
//     modprobe [-n] -a modulename...
//
// Author:
//     <NAME> <<EMAIL>>
package main

import (
	"flag"
	"log"
	"os"
	"strings"

	"github.com/u-root/u-root/pkg/kmodule"
)

const cmd = "modprobe [-an] modulename[s] [parameters...]"

var (
	dryRun     = flag.Bool("n", false, "Dry run")
	all        = flag.Bool("a", false, "Insert all module names on the command line.")
	verboseAll = flag.Bool("va", false, "Insert all module names on the command line.")
	rootDir    = flag.String("d", "/", "Root directory for modules")
)

func init() {
	defUsage := flag.Usage
	flag.Usage = func() {
		os.Args[0] = cmd
		defUsage()
	}
}

func main() {
	flag.Parse()

	if flag.NArg() == 0 {
		log.Println("Usage: ERROR: one module and optional module options.")
		flag.Usage()
		os.Exit(1)
	}

	opts := kmodule.ProbeOpts{
		RootDir: *rootDir,
	}
	if *dryRun {
		log.Println("Unique dependencies in load order, already loaded ones get skipped:")
		opts.DryRunCB = func(modPath string) {
			log.Println(modPath)
		}
{'fraction_non_alphanumeric': 0.1545912437039907, 'fraction_numerical': 0.008523827973653622, 'mean_word_length': 3.1049284578696343, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '4204359', 'n_tokens_mistral': 948, 'n_tokens_neox': 887, 'n_words': 280}