|
| 1 | +package cmd |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/carapace-sh/carapace" |
| 5 | + "github.com/carapace-sh/carapace-bin/pkg/actions/tools/pixi" |
| 6 | + "github.com/spf13/cobra" |
| 7 | +) |
| 8 | + |
| 9 | +var addCmd = &cobra.Command{ |
| 10 | + Use: "add", |
| 11 | + Short: "Adds dependencies to the workspace", |
| 12 | + Aliases: []string{"a"}, |
| 13 | + Run: func(cmd *cobra.Command, args []string) {}, |
| 14 | +} |
| 15 | + |
| 16 | +func init() { |
| 17 | + carapace.Gen(addCmd).Standalone() |
| 18 | + |
| 19 | + addCmd.Flags().String("auth-file", "", "Path to the file containing the authentication token") |
| 20 | + addCmd.Flags().String("branch", "", "The git branch") |
| 21 | + addCmd.Flags().String("concurrent-downloads", "", "Max concurrent network requests, default is `50`") |
| 22 | + addCmd.Flags().String("concurrent-solves", "", "Max concurrent solves, default is the number of CPUs") |
| 23 | + addCmd.Flags().Bool("editable", false, "Whether the pypi requirement should be editable") |
| 24 | + addCmd.Flags().StringP("feature", "f", "", "The feature for which the dependency should be modified") |
| 25 | + addCmd.Flags().Bool("frozen", false, "Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file") |
| 26 | + addCmd.Flags().StringP("git", "g", "", "The git url to use when adding a git dependency") |
| 27 | + addCmd.Flags().Bool("locked", false, "Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file") |
| 28 | + addCmd.Flags().Bool("no-install", false, "Don't modify the environment, only modify the lock-file") |
| 29 | + addCmd.Flags().String("pinning-strategy", "", "Set pinning strategy") |
| 30 | + addCmd.Flags().StringSliceP("platform", "p", nil, "The platform for which the dependency should be modified") |
| 31 | + addCmd.Flags().Bool("pypi", false, "The specified dependencies are pypi dependencies. Conflicts with `host` and `build`") |
| 32 | + addCmd.Flags().String("pypi-keyring-provider", "", "Specifies whether to use the keyring to look up credentials for PyPI") |
| 33 | + addCmd.Flags().String("rev", "", "The git revision") |
| 34 | + addCmd.Flags().Bool("run-post-link-scripts", false, "Run post-link scripts (insecure)") |
| 35 | + addCmd.Flags().StringP("subdir", "s", "", "The subdirectory of the git repository to use") |
| 36 | + addCmd.Flags().String("tag", "", "The git tag") |
| 37 | + addCmd.Flags().Bool("tls-no-verify", false, "Do not verify the TLS certificate of the server") |
| 38 | + addCmd.Flags().String("tls-root-certs", "", "Which TLS root certificates to use: 'webpki' (bundled Mozilla roots), 'native' (system store), or 'all' (both)") |
| 39 | + addCmd.Flags().Bool("use-environment-activation-cache", false, "Use environment activation cache (experimental)") |
| 40 | + rootCmd.AddCommand(addCmd) |
| 41 | + |
| 42 | + carapace.Gen(addCmd).FlagCompletion(carapace.ActionMap{ |
| 43 | + "auth-file": carapace.ActionFiles(), |
| 44 | + "feature": pixi.ActionFeatures(), |
| 45 | + "pinning-strategy": carapace.ActionValues("semver", "minor", "major", "latest-up", "exact-version", "no-pin"), |
| 46 | + "platform": pixi.ActionPlatforms(), |
| 47 | + "pypi-keyring-provider": carapace.ActionValues("disabled", "subprocess"), |
| 48 | + }) |
| 49 | + |
| 50 | + carapace.Gen(addCmd).PositionalAnyCompletion( |
| 51 | + pixi.ActionPackageSearch(), |
| 52 | + ) |
| 53 | +} |
0 commit comments