bundle.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package main
  2. import (
  3. "github.com/spf13/cobra"
  4. )
  5. var (
  6. bundleCreateCommand = &cobra.Command{
  7. Use: "create",
  8. Short: "Create a bundle",
  9. Long: "Create a bundle",
  10. Run: func(c *cobra.Command, args []string) {
  11. },
  12. }
  13. bundleAnalyzeCommand = &cobra.Command{
  14. Use: "analyze",
  15. Short: "List all dependencies",
  16. Long: "List all dependencies",
  17. Run: func(c *cobra.Command, args []string) {
  18. },
  19. }
  20. bundleAppendDependencyCommand = &cobra.Command{
  21. Use: "append",
  22. Short: "Append a dependency",
  23. Long: "Append a dependency",
  24. }
  25. bundleAppendGithubDependencyCommand = &cobra.Command{
  26. Use: "github",
  27. Short: "Append a github dependency",
  28. Long: "Append a github dependency",
  29. Run: func(c *cobra.Command, args []string) {
  30. },
  31. }
  32. bundleAppendMarketplaceDependencyCommand = &cobra.Command{
  33. Use: "marketplace",
  34. Short: "Append a marketplace dependency",
  35. Long: "Append a marketplace dependency",
  36. Run: func(c *cobra.Command, args []string) {
  37. },
  38. }
  39. bundleAppendPackageDependencyCommand = &cobra.Command{
  40. Use: "package",
  41. Short: "Append a local package dependency",
  42. Long: "Append a local package dependency",
  43. Run: func(c *cobra.Command, args []string) {
  44. },
  45. }
  46. bundleRegenerateCommand = &cobra.Command{
  47. Use: "regenerate",
  48. Short: "Regenerate the bundle",
  49. Long: "Regenerate the bundle",
  50. Run: func(c *cobra.Command, args []string) {
  51. },
  52. }
  53. bundleRemoveDependencyCommand = &cobra.Command{
  54. Use: "remove",
  55. Short: "Remove a dependency",
  56. Long: "Remove a dependency",
  57. Run: func(c *cobra.Command, args []string) {
  58. },
  59. }
  60. bundleBumpVersionCommand = &cobra.Command{
  61. Use: "bump",
  62. Short: "Bump the version of the bundle",
  63. Long: "Bump the version of the bundle",
  64. Run: func(c *cobra.Command, args []string) {
  65. },
  66. }
  67. bundleListDependenciesCommand = &cobra.Command{
  68. Use: "list",
  69. Short: "List all dependencies",
  70. Long: "List all dependencies",
  71. Run: func(c *cobra.Command, args []string) {
  72. },
  73. }
  74. )
  75. func init() {
  76. bundleCommand.AddCommand(bundleCreateCommand)
  77. bundleCommand.AddCommand(bundleAppendDependencyCommand)
  78. bundleAppendDependencyCommand.AddCommand(bundleAppendGithubDependencyCommand)
  79. bundleAppendDependencyCommand.AddCommand(bundleAppendMarketplaceDependencyCommand)
  80. bundleAppendDependencyCommand.AddCommand(bundleAppendPackageDependencyCommand)
  81. bundleCommand.AddCommand(bundleRemoveDependencyCommand)
  82. bundleCommand.AddCommand(bundleRegenerateCommand)
  83. bundleCommand.AddCommand(bundleBumpVersionCommand)
  84. bundleCommand.AddCommand(bundleListDependenciesCommand)
  85. bundleCommand.AddCommand(bundleAnalyzeCommand)
  86. bundleAppendDependencyCommand.Flags().StringP("bundle_path", "i", "", "path to the bundle file")
  87. bundleAppendDependencyCommand.MarkFlagRequired("bundle_path")
  88. bundleAppendGithubDependencyCommand.Flags().StringP("repo_pattern", "r", "", "github repo pattern")
  89. bundleAppendGithubDependencyCommand.MarkFlagRequired("repo_pattern")
  90. bundleAppendMarketplaceDependencyCommand.Flags().StringP("marketplace_pattern", "m", "", "marketplace pattern")
  91. bundleAppendMarketplaceDependencyCommand.MarkFlagRequired("marketplace_pattern")
  92. bundleAppendPackageDependencyCommand.Flags().StringP("package_path", "p", "", "path to the package")
  93. bundleAppendPackageDependencyCommand.MarkFlagRequired("package_path")
  94. }