mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #14364 from jwhonce/wip/diff_todo
Remove unused archive flag from diff commands
This commit is contained in:
@ -32,13 +32,9 @@ func init() {
|
|||||||
Parent: containerCmd,
|
Parent: containerCmd,
|
||||||
})
|
})
|
||||||
|
|
||||||
diffOpts = &entities.DiffOptions{}
|
diffOpts = new(entities.DiffOptions)
|
||||||
flags := diffCmd.Flags()
|
flags := diffCmd.Flags()
|
||||||
|
|
||||||
// FIXME: Why does this exists? It is not used anywhere.
|
|
||||||
flags.BoolVar(&diffOpts.Archive, "archive", true, "Save the diff as a tar archive")
|
|
||||||
_ = flags.MarkHidden("archive")
|
|
||||||
|
|
||||||
formatFlagName := "format"
|
formatFlagName := "format"
|
||||||
flags.StringVar(&diffOpts.Format, formatFlagName, "", "Change the output format (json)")
|
flags.StringVar(&diffOpts.Format, formatFlagName, "", "Change the output format (json)")
|
||||||
_ = diffCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(nil))
|
_ = diffCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(nil))
|
||||||
|
@ -35,9 +35,6 @@ func init() {
|
|||||||
Command: diffCmd,
|
Command: diffCmd,
|
||||||
})
|
})
|
||||||
flags := diffCmd.Flags()
|
flags := diffCmd.Flags()
|
||||||
// FIXME: Why does this exists? It is not used anywhere.
|
|
||||||
flags.BoolVar(&diffOpts.Archive, "archive", true, "Save the diff as a tar archive")
|
|
||||||
_ = flags.MarkHidden("archive")
|
|
||||||
|
|
||||||
formatFlagName := "format"
|
formatFlagName := "format"
|
||||||
flags.StringVar(&diffOpts.Format, formatFlagName, "", "Change the output format (json)")
|
flags.StringVar(&diffOpts.Format, formatFlagName, "", "Change the output format (json)")
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Diff(cmd *cobra.Command, args []string, options entities.DiffOptions) error {
|
func Diff(_ *cobra.Command, args []string, options entities.DiffOptions) error {
|
||||||
results, err := registry.ContainerEngine().Diff(registry.GetContext(), args, options)
|
results, err := registry.ContainerEngine().Diff(registry.GetContext(), args, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -63,7 +63,7 @@ func changesToTable(diffs *entities.DiffReport) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDOrLatestArgs used to validate a nameOrId was provided or the "--latest" flag
|
// ValidateContainerDiffArgs used to validate a nameOrId was provided or the "--latest" flag
|
||||||
func ValidateContainerDiffArgs(cmd *cobra.Command, args []string) error {
|
func ValidateContainerDiffArgs(cmd *cobra.Command, args []string) error {
|
||||||
given, _ := cmd.Flags().GetBool("latest")
|
given, _ := cmd.Flags().GetBool("latest")
|
||||||
if len(args) > 0 && !given {
|
if len(args) > 0 && !given {
|
||||||
|
@ -34,9 +34,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func diffFlags(flags *pflag.FlagSet) {
|
func diffFlags(flags *pflag.FlagSet) {
|
||||||
diffOpts = &entities.DiffOptions{}
|
diffOpts = new(entities.DiffOptions)
|
||||||
flags.BoolVar(&diffOpts.Archive, "archive", true, "Save the diff as a tar archive")
|
|
||||||
_ = flags.MarkDeprecated("archive", "Provided for backwards compatibility, has no impact on output.")
|
|
||||||
|
|
||||||
formatFlagName := "format"
|
formatFlagName := "format"
|
||||||
flags.StringVar(&diffOpts.Format, formatFlagName, "", "Change the output format (json)")
|
flags.StringVar(&diffOpts.Format, formatFlagName, "", "Change the output format (json)")
|
||||||
|
@ -80,7 +80,6 @@ type InspectOptions struct {
|
|||||||
type DiffOptions struct {
|
type DiffOptions struct {
|
||||||
Format string `json:",omitempty"` // CLI only
|
Format string `json:",omitempty"` // CLI only
|
||||||
Latest bool `json:",omitempty"` // API and CLI, only supported by containers
|
Latest bool `json:",omitempty"` // API and CLI, only supported by containers
|
||||||
Archive bool `json:",omitempty"` // CLI only
|
|
||||||
Type define.DiffType // Type which should be compared
|
Type define.DiffType // Type which should be compared
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user