reposcan

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package reposcan exposes the CLI entry points for the reposcan command. It wires configuration, flag parsing, repository scanning, and rendering.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:           "reposcan",
	Short:         "Scan directories for Git repositories and report status",
	Long:          "RepoScan scans one or more root directories for Git repositories and reports uncommitted, ahead/behind status.",
	SilenceUsage:  true,
	SilenceErrors: true,
	RunE: func(cmd *cobra.Command, args []string) error {

		paths := config.DefaultPaths()
		configs, err := config.CreateOrReadConfigs(paths.ConfigFilePath)
		if err != nil {
			fmt.Println(err)
			return err
		}

		validationResult := config.Validate(configs)
		if validationResult.IsValid() {
			validationResult.Print()
			return err
		}

		err = readFlags(cmd, &configs)
		if err != nil {
			return err
		}

		validationResult = config.Validate(configs)
		if validationResult.IsValid() {
			validationResult.Print()
			return fmt.Errorf("invalid configuration after flags")
		}

		logger.Init(configs.Debug, paths.LogFileDir)

		validationResult.Log()

		return run(configs)
	},
}

RootCmd is the root Cobra command implementing the reposcan CLI. It parses flags, loads configuration, runs the scan, and renders output.

Functions

func Execute

func Execute()

Execute runs the root Cobra command for the reposcan CLI. It exits the process with a non-zero status on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL