pkg

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddCmd = &cobra.Command{
	Use:                   "add -t Type -n Name [filename]...",
	Short:                 "Add metadata item to package.xml",
	DisableFlagsInUseLine: true,
	Args:                  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			add(file, metadataType, name)
		}
	},
}
View Source
var DeleteCmd = &cobra.Command{
	Use:                   "delete -t Type -n Name [filename]...",
	Short:                 "Remove metadata item from package.xml",
	DisableFlagsInUseLine: true,
	Args:                  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			deleteMember(file, metadataType, name)
		}
	},
}
View Source
var ListCmd = &cobra.Command{
	Use:                   "list [filename]...",
	Short:                 "list items in package.xml",
	DisableFlagsInUseLine: true,
	Args:                  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			listMembers(file)
		}
	},
}
View Source
var NewCmd = &cobra.Command{
	Use:                   "new [filename]...",
	Short:                 "Create new package.xml file",
	DisableFlagsInUseLine: true,
	Args:                  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			createFile(file)
		}
	},
}
View Source
var TidyCmd = &cobra.Command{
	Use:                   "tidy [filename]...",
	Short:                 "Tidy package.xml",
	DisableFlagsInUseLine: true,
	Args:                  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		changes := false
		for _, file := range args {
			list, _ := cmd.Flags().GetBool("list")
			if list {
				needsTidying := checkIfChanged(file)
				changes = needsTidying || changes
			} else {
				tidy(file)
			}
		}
		if changes {
			os.Exit(1)
		}
	},
}

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