|
| 1 | +package cmd |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/carapace-sh/carapace" |
| 5 | + "github.com/spf13/cobra" |
| 6 | +) |
| 7 | + |
| 8 | +var rootCmd = &cobra.Command{ |
| 9 | + Use: "xbps-create [OPTIONS] -A <arch> -n <pkgver> -s \"<desc>\" destdir", |
| 10 | + Short: "XBPS utility to create binary packages", |
| 11 | + Long: "https://man.voidlinux.org/xbps-create", |
| 12 | + Run: func(cmd *cobra.Command, args []string) {}, |
| 13 | +} |
| 14 | + |
| 15 | +func Execute() error { |
| 16 | + return rootCmd.Execute() |
| 17 | +} |
| 18 | +func init() { |
| 19 | + carapace.Gen(rootCmd).Standalone() |
| 20 | + |
| 21 | + rootCmd.Flags().String("alternatives", "", "List of available alternatives this pkg provides") |
| 22 | + rootCmd.Flags().StringP("architecture", "A", "", "Package architecture (e.g: noarch, i686, etc)") |
| 23 | + rootCmd.Flags().String("build-options", "", "A string with the used build options") |
| 24 | + rootCmd.Flags().StringP("built-with", "B", "", "Package builder string (e.g: xbps-src-30)") |
| 25 | + rootCmd.Flags().StringP("changelog", "c", "", "Changelog URL") |
| 26 | + rootCmd.Flags().String("compression", "zstd", "Compression format: none, gzip, bzip2, lz4, xz, zstd (default)") |
| 27 | + rootCmd.Flags().StringP("config-files", "F", "", "Configuration files (blank separated list)") |
| 28 | + rootCmd.Flags().StringP("conflicts", "C", "", "Conflicts (blank separated list, e.g: 'foo>=2.0 blah<=2.0')") |
| 29 | + rootCmd.Flags().StringP("dependencies", "D", "", "Dependencies (blank separated list, e.g: 'foo>=1.0_1 blah<2.1')") |
| 30 | + rootCmd.Flags().StringP("desc", "s", "", "Short description (max 80 characters)") |
| 31 | + rootCmd.Flags().BoolP("help", "h", false, "Show usage") |
| 32 | + rootCmd.Flags().StringP("homepage", "H", "", "Homepage") |
| 33 | + rootCmd.Flags().StringP("license", "l", "", "License") |
| 34 | + rootCmd.Flags().StringP("long-desc", "S", "", "Long description (80 cols per line)") |
| 35 | + rootCmd.Flags().StringP("maintainer", "m", "", "Maintainer") |
| 36 | + rootCmd.Flags().StringP("mutable-files", "M", "", "Mutable files list (blank separated list)") |
| 37 | + rootCmd.Flags().StringP("pkgver", "n", "", "Package name/version tuple (e.g: foo-1.0_1)") |
| 38 | + rootCmd.Flags().BoolP("preserve", "p", false, "Enable package preserve boolean") |
| 39 | + rootCmd.Flags().StringP("provides", "P", "", "Provides (blank separated list, e.g: 'foo-9999 blah-1.0')") |
| 40 | + rootCmd.Flags().BoolP("quiet", "q", false, "Work silently") |
| 41 | + rootCmd.Flags().StringP("replaces", "R", "", "Replaces (blank separated list, e.g: 'foo>=1.0 blah<2.0')") |
| 42 | + rootCmd.Flags().StringP("reverts", "r", "", "Reverts (blank separated list, e.g: '1.0_1 2.0_3')") |
| 43 | + rootCmd.Flags().String("shlib-provides", "", "List of provided shared libraries") |
| 44 | + rootCmd.Flags().String("shlib-requires", "", "List of required shared libraries") |
| 45 | + rootCmd.Flags().StringP("tags", "t", "", "A list of tags/categories (blank separated list)") |
| 46 | + rootCmd.Flags().BoolP("version", "V", false, "Show XBPS version") |
| 47 | + |
| 48 | + rootCmd.MarkFlagRequired("architecture") |
| 49 | + rootCmd.MarkFlagRequired("pkgver") |
| 50 | + rootCmd.MarkFlagRequired("desc") |
| 51 | + |
| 52 | + carapace.Gen(rootCmd).PositionalCompletion(carapace.ActionDirectories()) |
| 53 | +} |
0 commit comments