cmd

package
v0.0.0-...-231b332 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "go-sort [command] [flags]",
	Short: "Go-sort is a cli tool that allows you to quickly sort large files.",
	Long: `Go-Sort is a tool produced for PRiR (UMK) classes.
Its functionalities are:
	- generation of a sample file
	- multi-threaded sorting
	- sorting verification
Implementations can be found at: https://github.com/CezikLikeWhat/PRIR_Sorting`,
	Example:       "go-sort [input | sort | verify] [flags]",
	Version:       "1.0.0",
	SilenceErrors: true,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if configuration.TimeMeasuring {
			configuration.AppTimer.Start = time.Now()
		}
	},
	Run: func(cmd *cobra.Command, args []string) {
		err := cmd.Help()
		if err != nil {
			log.Fatalf("Cannot display help message | Error: %s", err)
		}
	},
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		if configuration.TimeMeasuring {
			configuration.AppTimer.Elapsed = time.Since(configuration.AppTimer.Start)
			fmt.Printf("Action took: %fs (%s)\n", configuration.AppTimer.Elapsed.Seconds(), configuration.AppTimer.Elapsed)
		}
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

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