commands

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

All contains all available commands for cpackget

View Source
var IndexCmd = &cobra.Command{
	Use:   "index <index url>",
	Short: "Updates public index",
	Long: `Updates the public index in CMSIS_PACK_ROOT/.Web/index.pidx using the file specified by the given url.
If there's already an index file, cpackget won't overwrite it. Use "-f" to do so.`,
	PersistentPreRunE: configureInstaller,
	Args:              cobra.ExactArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		log.Infof("Updating index %v", args)
		indexPath := args[0]
		return installer.UpdatePublicIndex(indexPath, overwrite)
	},
}
View Source
var InitCmd = &cobra.Command{
	Use:   "init [--pack-root <pack root>] [index-url]",
	Short: "Initializes a pack root folder",
	Long: `Initializes a pack root folder specified by -R/--pack-root command line
or via the CMSIS_PACK_ROOT environment variable with the following contents:
  - .Download/
  - .Local/
  - .Web/
  - .Web/index.pidx (downloaded from <index-url>)`,
	Args: cobra.MaximumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		packRoot := viper.GetString("pack-root")
		var indexPath string
		if len(args) > 0 {
			indexPath = args[0]
		}

		log.Debugf("Initializing a new pack root in \"%v\" using index url \"%v\"", packRoot, indexPath)

		createPackRoot = true
		err := configureInstaller(cmd, args)
		if err != nil {
			return err
		}

		if len(indexPath) > 0 {
			return installer.UpdatePublicIndex(indexPath, true)
		}

		return nil
	},
}
View Source
var PackCmd = &cobra.Command{
	Use:               "pack",
	Short:             "Adds/Removes Open-CMSIS-Pack packages",
	Long:              "Adds/Removes Open-CMSIS-Pack packages from a local file or a file hosted somewhere else on the Internet.",
	PersistentPreRunE: configureInstaller,
}
View Source
var PdscCmd = &cobra.Command{
	Use:               "pdsc",
	Short:             "Adds or removes Open-CMSIS-Pack packages in the local file system via PDSC files.",
	PersistentPreRunE: configureInstaller,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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