|
| 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-uchroot [OPTIONS] [--] <dir> <cmd> [<cmdargs>]", |
| 10 | + Short: "XBPS utility to chroot and bind mount with Linux namespaces", |
| 11 | + Run: func(cmd *cobra.Command, args []string) {}, |
| 12 | +} |
| 13 | + |
| 14 | +func Execute() error { |
| 15 | + return rootCmd.Execute() |
| 16 | +} |
| 17 | +func init() { |
| 18 | + carapace.Gen(rootCmd).Standalone() |
| 19 | + |
| 20 | + rootCmd.Flags().StringP("bind-ro", "B", "", "Bind mounts <src> into <dir>/<dest> (read-only)") |
| 21 | + rootCmd.Flags().StringP("bind-rw", "b", "", "Bind mounts <src> into <dir>/<dest> (read-write)") |
| 22 | + rootCmd.Flags().BoolP("overlayfs", "O", false, "Creates a tempdir and mounts <dir> read-only via overlayfs") |
| 23 | + rootCmd.Flags().BoolP("tmpfs", "t", false, "Creates a tempdir and mounts <dir> on tmpfs (for use with -O)") |
| 24 | + rootCmd.Flags().StringP("options", "o", "", "Options to be passed to the tmpfs mount (for use with -t)") |
| 25 | + rootCmd.Flags().BoolP("help", "h", false, "Show usage") |
| 26 | + rootCmd.Flags().BoolP("verbose", "v", false, "Show XBPS version") |
| 27 | + |
| 28 | + carapace.Gen(rootCmd).PositionalCompletion(carapace.ActionDirectories()) |
| 29 | +} |
0 commit comments