cmd

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LevelIds = map[zapcore.Level][]string{
	zap.DebugLevel: {"debug"},
	zap.InfoLevel:  {"info"},
	zap.WarnLevel:  {"warn"},
	zap.ErrorLevel: {"error"},
}
View Source
var RootCmd = &cobra.Command{
	Use:   "nuro",
	Short: "Get more information about your docker images",
	Args:  cobra.NoArgs,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		log.Init(loglevel, cmd.ErrOrStderr())

		if netRCFile, _ := cmd.Flags().GetString("netrc-file"); netRCFile != "" {
			if err := auth.LoadNetRCFile(cmd.Context(), netRCFile); err != nil {
				return fmt.Errorf("loading netrc file: %w", err)
			}
		} else if netRCFromStdin, _ := cmd.Flags().GetBool("netrc-stdin"); netRCFromStdin {
			if stdin, err := io.ReadAll(os.Stdin); err != nil {
				return fmt.Errorf("reading netrc from stdin: %w", err)
			} else {
				if err := auth.LoadNetRC(cmd.Context(), string(stdin)); err != nil {
					return fmt.Errorf("loading netrc file: %w", err)
				}
			}
		}

		return nil
	},
	PersistentPostRunE: func(cmd *cobra.Command, args []string) error {
		return log.Close()
	},
	SilenceUsage:  true,
	SilenceErrors: true,
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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