Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cmd/nerdctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ func initRootCmdFlags(rootCmd *cobra.Command, tomlPath string) error {
}
rootCmd.PersistentFlags().Bool("debug", cfg.Debug, "debug mode")
rootCmd.PersistentFlags().Bool("debug-full", cfg.DebugFull, "debug mode (with full output)")
// -a is nonPersistentAlias (conflicts with nerdctl images -a)
AddPersistentStringFlag(rootCmd, "address", []string{"host"}, []string{"a", "H"}, cfg.Address, "CONTAINERD_ADDRESS", `containerd address, optionally with "unix://" prefix`)
// -n is nonPersistentAlias (conflicts with nerdctl logs -n)
AddPersistentStringFlag(rootCmd, "namespace", nil, []string{"n"}, cfg.Namespace, "CONTAINERD_NAMESPACE", `containerd namespace, such as "moby" for Docker, "k8s.io" for Kubernetes`)
AddPersistentStringFlag(rootCmd, "address", []string{"host", "a"}, []string{"H"}, cfg.Address, "CONTAINERD_ADDRESS", `containerd address, optionally with "unix://" prefix`)
AddPersistentStringFlag(rootCmd, "namespace", []string{"n"}, nil, cfg.Namespace, "CONTAINERD_NAMESPACE", `containerd namespace, such as "moby" for Docker, "k8s.io" for Kubernetes`)
rootCmd.RegisterFlagCompletionFunc("namespace", shellCompleteNamespaceNames)
AddPersistentStringFlag(rootCmd, "snapshotter", []string{"storage-driver"}, nil, cfg.Snapshotter, "CONTAINERD_SNAPSHOTTER", "containerd snapshotter")
rootCmd.RegisterFlagCompletionFunc("snapshotter", shellCompleteSnapshotterNames)
Expand Down Expand Up @@ -299,6 +297,7 @@ Config file ($NERDCTL_TOML): %s
)
addApparmorCommand(rootCmd)
addCpCommand(rootCmd)

return rootCmd, nil
}

Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ require (
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect
github.com/ipfs/go-block-format v0.0.3 // indirect
github.com/ipfs/go-blockservice v0.3.0 // indirect
Expand Down Expand Up @@ -185,4 +185,7 @@ replace (
github.com/containerd/containerd => github.com/containerd/containerd v1.6.1-0.20220807041520-6deb1174fbfc
// Temporary fork for avoiding importing patent-protected code: https://github.com/hashicorp/golang-lru/issues/73
github.com/hashicorp/golang-lru => github.com/ktock/golang-lru v0.5.5-0.20211029085301-ec551be6f75c
// Temporary fork for parent flags persistence: https://github.com/spf13/cobra/pull/1795
github.com/spf13/cobra => github.com/fahedouch/cobra v0.0.0-20220905130657-0c653d6e38ad
github.com/spf13/pflag => github.com/fahedouch/pflag v0.0.0-20220905133355-1113e9b3fb8b
)
Loading