initial version with incorrect flag types and descriptionsg
This commit is contained in:
Ralf Steube 2025-03-02 10:29:26 +01:00 committed by GitHub
parent 680d1ecd1d
commit 981bf794e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
35 changed files with 792 additions and 0 deletions

8
.docker/ubuntu.yaml Normal file
View File

@ -0,0 +1,8 @@
services:
ubuntu:
build:
context: ubuntu
image: ghcr.io/carapace-sh/carapace-bin:ubuntu
hostname: carapace-bin:ubuntu
volumes:
- '..:/carapace-bin:ro'

10
.docker/ubuntu/Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM ubuntu
RUN apt-get update \
&& apt-get install -y elvish
RUN mkdir -p ~/.config/elvish \
&& echo "set paths = [ /carapace-bin/cmd/carapace \$@paths ]\neval (carapace _carapace|slurp)" > ~/.config/elvish/rc.elv
ENV PATH="/carapace-bin/cmd/carapace:$PATH"
ENTRYPOINT [ "elvish" ]

View File

@ -0,0 +1,20 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var autocleanCmd = &cobra.Command{
Use: "autoclean",
Short: "clean obsolete packages and scripts from archive",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(autocleanCmd).Standalone()
autocleanCmd.Flags().Bool("dry-run", false, "perform a simulation of events taken")
autocleanCmd.Flags().BoolP("simulate", "s", false, "perform a simulation of events taken")
rootCmd.AddCommand(autocleanCmd)
}

View File

@ -0,0 +1,21 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/spf13/cobra"
)
var autopurgeCmd = &cobra.Command{
Use: "autopurge",
Short: "automatically purge all unused packages",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(autopurgeCmd).Standalone()
common.AddGetFlags(autopurgeCmd)
common.ActionInstallFlags(autopurgeCmd)
rootCmd.AddCommand(autopurgeCmd)
}

View File

@ -0,0 +1,21 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/spf13/cobra"
)
var autoremoveCmd = &cobra.Command{
Use: "autoremove",
Short: "automatically remove all unused packages",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(autoremoveCmd).Standalone()
common.AddGetFlags(autoremoveCmd)
common.ActionInstallFlags(autoremoveCmd)
rootCmd.AddCommand(autoremoveCmd)
}

View File

@ -0,0 +1,33 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var buildDepCmd = &cobra.Command{
Use: "build-dep package...",
Short: "install build dependencies",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(buildDepCmd).Standalone()
buildDepCmd.Flags().BoolP("build-profiles", "P", false, "activated build profiles")
buildDepCmd.Flags().Bool("dry-run", false, "perform a simulation of events taken")
buildDepCmd.Flags().BoolP("host-architecture", "a", false, "architecture")
buildDepCmd.Flags().Bool("no-strict-pinning", false, "consider all versions of a package")
buildDepCmd.Flags().Bool("purge", false, "remove and purge packages")
buildDepCmd.Flags().BoolP("simulate", "s", false, "perform a simulation of events taken")
buildDepCmd.Flags().String("solver", "", "set solver")
buildDepCmd.Flags().StringP("target-release", "t", "", "target-release")
common.AddGetFlags(buildDepCmd)
rootCmd.AddCommand(buildDepCmd)
carapace.Gen(buildDepCmd).PositionalAnyCompletion(
apt.ActionPackageSearch().FilterArgs(),
)
}

View File

@ -0,0 +1,22 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var changelogCmd = &cobra.Command{
Use: "changelog [pattern]...",
Short: "show package changelog",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(changelogCmd).Standalone()
rootCmd.AddCommand(changelogCmd)
carapace.Gen(changelogCmd).PositionalAnyCompletion(
apt.ActionPackageSearch(),
)
}

View File

@ -0,0 +1,20 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var cleanCmd = &cobra.Command{
Use: "clean",
Short: "clean packages and scripts from archive",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(cleanCmd).Standalone()
cleanCmd.Flags().Bool("dry-run", false, "perform a simulation of events taken")
cleanCmd.Flags().BoolP("simulate", "s", false, "perform a simulation of events taken")
rootCmd.AddCommand(cleanCmd)
}

View File

@ -0,0 +1,35 @@
package common
import "github.com/spf13/cobra"
func AddGetFlags(cmd *cobra.Command) {
// TODO documentation is lacking and descriptions are likely wrong
cmd.Flags().Bool("allow-change-held-packages", false, "allow changing held packages")
cmd.Flags().Bool("allow-downgrades", false, "allow downgrades")
cmd.Flags().Bool("allow-insecure-repositories", false, "allow insecure repositories")
cmd.Flags().Bool("allow-remove-essential", false, "allow removal of essential packages")
cmd.Flags().Bool("allow-unauthenticated", false, "allow unauthenticated packages")
cmd.Flags().Bool("arch-only", false, "only process architecture-dependent build-dependencies")
cmd.Flags().Bool("assume-no", false, "automatic \"no\" to all prompts")
cmd.Flags().BoolP("assume-yes", "y", false, "automatic \"yes\" to all prompts")
cmd.Flags().Bool("download", false, "download the given binary package into the current directory")
cmd.Flags().BoolP("download-only", "d", false, "do not unpack source package")
cmd.Flags().Bool("fix-missing", false, "fix missing packages")
cmd.Flags().Bool("fix-policy", false, "fix policies")
cmd.Flags().Bool("ignore-hold", false, "ignore package holds")
cmd.Flags().BoolP("ignore-missing", "m", false, "ignore missing packages")
cmd.Flags().Bool("install-recommends", false, "install recommended packages")
cmd.Flags().Bool("install-suggests", false, "install suggested packages")
cmd.Flags().Bool("no-install-recommends", false, "do not install recommended packages")
cmd.Flags().Bool("no-install-suggests", false, "do not install suggested packages")
cmd.Flags().Bool("only-upgrade", false, "only updgrade packages")
cmd.Flags().Bool("print-uris", false, "print file URIs")
cmd.Flags().Bool("remove", false, "remove packages")
cmd.Flags().BoolP("show-upgraded", "u", false, "show upgraded packages")
cmd.Flags().Bool("trivial-only", false, "only perform operations that are 'trivial'")
cmd.Flags().Bool("upgrade", false, "upgrade and install new dependencies")
cmd.MarkFlagsMutuallyExclusive("assume-no", "assume-yes")
cmd.MarkFlagsMutuallyExclusive("no-install-recommends", "install-recommends")
cmd.MarkFlagsMutuallyExclusive("no-install-suggests", "install-suggests")
}

View File

@ -0,0 +1,18 @@
package common
import "github.com/spf13/cobra"
func ActionInstallFlags(cmd *cobra.Command) {
// TODO documentation is lacking and descriptions are likely wrong
cmd.Flags().Bool("auto-remove", false, "automatically remove packages")
cmd.Flags().Bool("dry-run", false, "perform a simulation of events taken")
cmd.Flags().Bool("force-yes", false, "continue without prompting if it is changing held packages")
cmd.Flags().Bool("no-list-columns", false, "display package lists without arranging them in columns")
cmd.Flags().Bool("no-strict-pinning", false, "consider all versions of a package")
cmd.Flags().Bool("purge", false, "remove and purge packages")
cmd.Flags().Bool("reinstall", false, "reinstall package")
cmd.Flags().Bool("show-progress", false, "show progress")
cmd.Flags().BoolP("simulate", "s", false, "perform a simulation of events taken")
cmd.Flags().String("solver", "", "set solver")
cmd.Flags().Bool("verbose-versions", false, "show full versions")
}

View File

@ -0,0 +1,36 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var dependsCmd = &cobra.Command{
Use: "depends [pattern]...",
Short: "list package dependencies",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(dependsCmd).Standalone()
// TODO flag descriptions
dependsCmd.Flags().Bool("breaks", false, "")
dependsCmd.Flags().Bool("conflicts", false, "")
dependsCmd.Flags().Bool("depends", false, "")
dependsCmd.Flags().Bool("enhances", false, "")
dependsCmd.Flags().Bool("implicit", false, "")
dependsCmd.Flags().BoolP("important", "i", false, "")
dependsCmd.Flags().Bool("installed", false, "")
dependsCmd.Flags().Bool("pre-depends", false, "")
dependsCmd.Flags().Bool("recommends", false, "")
dependsCmd.Flags().Bool("recurse", false, "")
dependsCmd.Flags().Bool("replaces", false, "")
dependsCmd.Flags().Bool("suggests", false, "")
rootCmd.AddCommand(dependsCmd)
carapace.Gen(dependsCmd).PositionalAnyCompletion(
apt.ActionPackageSearch(),
)
}

View File

@ -0,0 +1,21 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/spf13/cobra"
)
var distUpgradeCmd = &cobra.Command{
Use: "dist-upgrade",
Short: "upgrade the system",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(distUpgradeCmd).Standalone()
common.AddGetFlags(distUpgradeCmd)
common.ActionInstallFlags(distUpgradeCmd)
rootCmd.AddCommand(distUpgradeCmd)
}

View File

@ -0,0 +1,22 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var downloadCmd = &cobra.Command{
Use: "download [pattern]...",
Short: "download package",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(downloadCmd).Standalone()
rootCmd.AddCommand(downloadCmd)
carapace.Gen(downloadCmd).PositionalAnyCompletion(
apt.ActionPackageSearch(),
)
}

View File

@ -0,0 +1,22 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var editSourcesCmd = &cobra.Command{
Use: "edit-sources [file]",
Short: "edit the source information file",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(editSourcesCmd).Standalone()
rootCmd.AddCommand(editSourcesCmd)
carapace.Gen(editSourcesCmd).PositionalCompletion(
carapace.ActionFiles().Chdir("/etc/apt/sources.list.d"),
)
}

View File

@ -0,0 +1,21 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/spf13/cobra"
)
var fullUpgradeCmd = &cobra.Command{
Use: "full-upgrade",
Short: "upgrade the system including removal of packages",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(fullUpgradeCmd).Standalone()
common.AddGetFlags(fullUpgradeCmd)
common.ActionInstallFlags(fullUpgradeCmd)
rootCmd.AddCommand(fullUpgradeCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var helpCmd = &cobra.Command{
Use: "help",
Short: "show help",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(helpCmd).Standalone()
rootCmd.AddCommand(helpCmd)
}

View File

@ -0,0 +1,23 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var infoCmd = &cobra.Command{
Use: "info package...",
Short: "show package information",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(infoCmd).Standalone()
rootCmd.AddCommand(infoCmd)
carapace.Gen(infoCmd).PositionalAnyCompletion(
apt.ActionPackageSearch().FilterArgs(),
)
}

View File

@ -0,0 +1,32 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/carapace-sh/carapace/pkg/condition"
"github.com/spf13/cobra"
)
var installCmd = &cobra.Command{
Use: "install [pattern]...",
Short: "install packages",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(installCmd).Standalone()
common.AddGetFlags(installCmd)
common.ActionInstallFlags(installCmd)
rootCmd.AddCommand(installCmd)
carapace.Gen(installCmd).PositionalAnyCompletion(
carapace.ActionCallback(func(c carapace.Context) carapace.Action {
if condition.CompletingPath(c) {
return carapace.ActionFiles()
}
return apt.ActionPackageSearch()
}),
)
}

View File

@ -0,0 +1,24 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var listCmd = &cobra.Command{
Use: "list [pattern]...",
Short: "list packages based on package names",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(listCmd).Standalone()
listCmd.Flags().BoolP("all-versions", "a", false, "print full records for all available versions")
listCmd.Flags().Bool("installed", false, "list installed packages")
listCmd.Flags().Bool("manual-installed", false, "list manually installed packages")
listCmd.Flags().StringP("target-release", "t", "", "which distribution packages to retrieved from")
listCmd.Flags().Bool("upgradable", false, "list upgradable packages")
listCmd.Flags().BoolP("verbose", "v", false, "verbose output")
rootCmd.AddCommand(listCmd)
}

View File

@ -0,0 +1,20 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var mooCmd = &cobra.Command{
Use: "moo",
Short: "",
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(mooCmd).Standalone()
mooCmd.Flags().Bool("color", false, "use color")
rootCmd.AddCommand(mooCmd)
}

View File

@ -0,0 +1,23 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var policyCmd = &cobra.Command{
Use: "policy [pattern]...",
Short: "show package priorities",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(policyCmd).Standalone()
rootCmd.AddCommand(policyCmd)
carapace.Gen(policyCmd).PositionalAnyCompletion(
apt.ActionPackageSearch().FilterArgs(),
)
}

View File

@ -0,0 +1,21 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/spf13/cobra"
)
var purgeCmd = &cobra.Command{
Use: "purge",
Short: "remove package including config and data",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(purgeCmd).Standalone()
common.AddGetFlags(purgeCmd)
common.ActionInstallFlags(purgeCmd)
rootCmd.AddCommand(purgeCmd)
}

View File

@ -0,0 +1,36 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var rdependsCmd = &cobra.Command{
Use: "rdepends [pattern]...",
Short: "list package dependents",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(rdependsCmd).Standalone()
// TODO flag descriptions
rdependsCmd.Flags().Bool("breaks", false, "")
rdependsCmd.Flags().Bool("conflicts", false, "")
rdependsCmd.Flags().Bool("enhances", false, "")
rdependsCmd.Flags().Bool("implicit", false, "")
rdependsCmd.Flags().BoolP("important", "i", false, "")
rdependsCmd.Flags().Bool("installed", false, "")
rdependsCmd.Flags().Bool("pre-rdepends", false, "")
rdependsCmd.Flags().Bool("rdepends", false, "")
rdependsCmd.Flags().Bool("recommends", false, "")
rdependsCmd.Flags().Bool("recurse", false, "")
rdependsCmd.Flags().Bool("replaces", false, "")
rdependsCmd.Flags().Bool("suggests", false, "")
rootCmd.AddCommand(rdependsCmd)
carapace.Gen(rdependsCmd).PositionalAnyCompletion(
apt.ActionPackageSearch(),
)
}

View File

@ -0,0 +1,26 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var reinstallCmd = &cobra.Command{
Use: "reinstall [pattern]...",
Short: "reinstall packages",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(reinstallCmd).Standalone()
common.AddGetFlags(reinstallCmd)
common.ActionInstallFlags(reinstallCmd)
rootCmd.AddCommand(reinstallCmd)
carapace.Gen(reinstallCmd).PositionalAnyCompletion(
apt.ActionPackages(),
)
}

View File

@ -0,0 +1,26 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var removeCmd = &cobra.Command{
Use: "remove [pattern]...",
Short: "remove package binaries",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(removeCmd).Standalone()
common.AddGetFlags(removeCmd)
common.ActionInstallFlags(removeCmd)
rootCmd.AddCommand(removeCmd)
carapace.Gen(removeCmd).PositionalAnyCompletion(
apt.ActionPackages(),
)
}

View File

@ -0,0 +1,32 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "apt",
Short: "apt is a commandline package manager",
Long: "https://salsa.debian.org/apt-team/apt",
Run: func(cmd *cobra.Command, args []string) {},
}
func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()
rootCmd.Flags().StringS("c", "c", "", "config file")
rootCmd.Flags().BoolP("help", "h", false, "show help")
rootCmd.Flags().StringP("host-architecture", "a", "", "architecture")
rootCmd.Flags().StringP("option", "o", "", "config string")
rootCmd.Flags().StringP("target-release", "t", "", "target release")
rootCmd.Flags().BoolP("version", "v", false, "show version")
// TODO release/architecture
carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"c": carapace.ActionFiles(),
})
}

View File

@ -0,0 +1,23 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var satisfyCmd = &cobra.Command{
Use: "satisfy [pattern]...",
Short: "satisfy dependency strings",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(satisfyCmd).Standalone()
rootCmd.AddCommand(satisfyCmd)
carapace.Gen(satisfyCmd).PositionalAnyCompletion(
apt.ActionPackageSearch(),
)
}

View File

@ -0,0 +1,20 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var searchCmd = &cobra.Command{
Use: "search [pattern]...",
Short: "search in package descriptions",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(searchCmd).Standalone()
searchCmd.Flags().BoolP("full", "f", false, "show full output")
searchCmd.Flags().BoolP("names-only", "n", false, "show only names")
rootCmd.AddCommand(searchCmd)
}

View File

@ -0,0 +1,24 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var showCmd = &cobra.Command{
Use: "show [pattern]...",
Short: "show package details",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(showCmd).Standalone()
showCmd.Flags().BoolP("all-versions", "a", false, "print full records for all available versions")
rootCmd.AddCommand(showCmd)
carapace.Gen(showCmd).PositionalAnyCompletion(
apt.ActionPackageSearch(),
)
}

View File

@ -0,0 +1,24 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var showsrcCmd = &cobra.Command{
Use: "showsrc [pattern]...",
Short: "showsrc package source",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(showsrcCmd).Standalone()
showsrcCmd.Flags().Bool("only-source", false, "display only source package names")
rootCmd.AddCommand(showsrcCmd)
carapace.Gen(showsrcCmd).PositionalAnyCompletion(
apt.ActionPackageSearch(),
)
}

View File

@ -0,0 +1,35 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers_release/apt_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var sourceCmd = &cobra.Command{
Use: "source [pattern]...",
Short: "download source package",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(sourceCmd).Standalone()
sourceCmd.Flags().BoolP("build", "b", false, "compile source packages after downloading them")
sourceCmd.Flags().BoolP("build-profiles", "P", false, "activated build profiles")
sourceCmd.Flags().Bool("compile", false, "compile source packages after downloading them")
sourceCmd.Flags().Bool("debian-only", false, "download only the debian file")
sourceCmd.Flags().Bool("diff-only", false, "download only the diff")
sourceCmd.Flags().Bool("dry-run", false, "perform a simulation of events taken")
sourceCmd.Flags().Bool("dsc-only", false, "download only the dsc file")
sourceCmd.Flags().BoolP("simulate", "s", false, "perform a simulation of events taken")
sourceCmd.Flags().Bool("tar-only", false, "download only the tar file")
// sourceCmd.Flags().BoolP("target-release", "t", false, "target release")
common.AddGetFlags(sourceCmd)
rootCmd.AddCommand(sourceCmd)
carapace.Gen(sourceCmd).PositionalAnyCompletion(
apt.ActionPackageSearch().FilterArgs(),
)
}

View File

@ -0,0 +1,21 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var updateCmd = &cobra.Command{
Use: "update",
Short: "update list of available packages",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(updateCmd).Standalone()
updateCmd.Flags().Bool("allow-insecure-repositories", false, "allow insecure repositories")
updateCmd.Flags().Bool("list-cleanup", false, "automatically manage the contents of /var/lib/apt/lists")
updateCmd.Flags().Bool("print-uris", false, "print file URIs")
rootCmd.AddCommand(updateCmd)
}

View File

@ -0,0 +1,26 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd/common"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/apt"
"github.com/spf13/cobra"
)
var upgradeCmd = &cobra.Command{
Use: "upgrade [pattern]...",
Short: "upgrade the system by installing/upgrading packages",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(upgradeCmd).Standalone()
common.AddGetFlags(upgradeCmd)
common.ActionInstallFlags(upgradeCmd)
rootCmd.AddCommand(upgradeCmd)
carapace.Gen(upgradeCmd).PositionalAnyCompletion(
apt.ActionPackages(),
)
}

View File

@ -0,0 +1,7 @@
package main
import "github.com/carapace-sh/carapace-bin/completers/apt_completer/cmd"
func main() {
cmd.Execute()
}

View File

@ -8,4 +8,5 @@ include:
- .docker/fzf-tab.yaml - .docker/fzf-tab.yaml
- .docker/gcloud.yaml - .docker/gcloud.yaml
- .docker/nix.yaml - .docker/nix.yaml
- .docker/ubuntu.yaml
- .docker/xbps.yaml - .docker/xbps.yaml