summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/rm.go3
-rw-r--r--cmd/podman/images/scp.go13
-rw-r--r--cmd/podman/machine/list.go26
-rw-r--r--cmd/podman/root.go9
-rw-r--r--cmd/podman/utils/error.go2
-rw-r--r--cmd/winpath/main.go4
6 files changed, 31 insertions, 26 deletions
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go
index 70cb76693..cede0ba14 100644
--- a/cmd/podman/containers/rm.go
+++ b/cmd/podman/containers/rm.go
@@ -61,7 +61,8 @@ func rmFlags(cmd *cobra.Command) {
flags.BoolVarP(&rmOptions.All, "all", "a", false, "Remove all containers")
flags.BoolVarP(&rmOptions.Ignore, "ignore", "i", false, "Ignore errors when a specified container is missing")
- flags.BoolVarP(&rmOptions.Force, "force", "f", false, "Force removal of a running or unusable container. The default is false")
+ flags.BoolVarP(&rmOptions.Force, "force", "f", false, "Force removal of a running or unusable container")
+ flags.BoolVar(&rmOptions.Depend, "depend", false, "Remove container and all containers that depend on the selected container")
timeFlagName := "time"
flags.UintVarP(&stopTimeout, timeFlagName, "t", containerConfig.Engine.StopTimeout, "Seconds to wait for stop before killing the container")
_ = cmd.RegisterFlagCompletionFunc(timeFlagName, completion.AutocompleteNone)
diff --git a/cmd/podman/images/scp.go b/cmd/podman/images/scp.go
index f02a3c15e..fb20d9417 100644
--- a/cmd/podman/images/scp.go
+++ b/cmd/podman/images/scp.go
@@ -46,6 +46,7 @@ var (
var (
parentFlags []string
+ quiet bool
source entities.ImageScpOptions
dest entities.ImageScpOptions
sshInfo entities.ImageScpConnections
@@ -61,7 +62,7 @@ func init() {
func scpFlags(cmd *cobra.Command) {
flags := cmd.Flags()
- flags.BoolVarP(&source.Quiet, "quiet", "q", false, "Suppress the output")
+ flags.BoolVarP(&quiet, "quiet", "q", false, "Suppress the output")
}
func scp(cmd *cobra.Command, args []string) (finalErr error) {
@@ -139,6 +140,7 @@ func scp(cmd *cobra.Command, args []string) (finalErr error) {
}
}
+ source.Quiet = quiet
source.File = f.Name() // after parsing the arguments, set the file for the save/load
dest.File = source.File
if err = os.Remove(source.File); err != nil { // remove the file and simply use its name so podman creates the file upon save. avoids umask errors
@@ -203,15 +205,6 @@ func scp(cmd *cobra.Command, args []string) (finalErr error) {
}
}
- src, err := json.MarshalIndent(source, "", " ")
- if err != nil {
- return err
- }
- dst, err := json.MarshalIndent(dest, "", " ")
- if err != nil {
- return err
- }
- fmt.Printf("SOURCE: %s\nDEST: %s\n", string(src), string(dst))
return nil
}
diff --git a/cmd/podman/machine/list.go b/cmd/podman/machine/list.go
index ed43b42df..3d8def0db 100644
--- a/cmd/podman/machine/list.go
+++ b/cmd/podman/machine/list.go
@@ -44,16 +44,19 @@ type listFlagType struct {
}
type machineReporter struct {
- Name string
- Default bool
- Created string
- Running bool
- LastUp string
- Stream string
- VMType string
- CPUs uint64
- Memory string
- DiskSize string
+ Name string
+ Default bool
+ Created string
+ Running bool
+ LastUp string
+ Stream string
+ VMType string
+ CPUs uint64
+ Memory string
+ DiskSize string
+ Port int
+ RemoteUsername string
+ IdentityPath string
}
func init() {
@@ -190,6 +193,9 @@ func toMachineFormat(vms []*machine.ListResponse) ([]*machineReporter, error) {
response.CPUs = vm.CPUs
response.Memory = strUint(vm.Memory)
response.DiskSize = strUint(vm.DiskSize)
+ response.Port = vm.Port
+ response.RemoteUsername = vm.RemoteUsername
+ response.IdentityPath = vm.IdentityPath
machineResponses = append(machineResponses, response)
}
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index bccc559ce..1de937ca5 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -114,6 +114,10 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
}
cfg := registry.PodmanConfig()
+ if cfg.NoOut {
+ null, _ := os.Open(os.DevNull)
+ os.Stdout = null
+ }
// Currently it is only possible to restore a container with the same runtime
// as used for checkpointing. It should be possible to make crun and runc
@@ -137,7 +141,7 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
runtimeFlag := cmd.Root().Flags().Lookup("runtime")
if runtimeFlag == nil {
return errors.Errorf(
- "Unexcpected error setting runtime to '%s' for restore",
+ "setting runtime to '%s' for restore",
*runtime,
)
}
@@ -217,7 +221,7 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
context := cmd.Root().LocalFlags().Lookup("context")
if context.Value.String() != "default" {
- return errors.New("Podman does not support swarm, the only --context value allowed is \"default\"")
+ return errors.New("podman does not support swarm, the only --context value allowed is \"default\"")
}
if !registry.IsRemote() {
if cmd.Flag("cpu-profile").Changed {
@@ -343,6 +347,7 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) {
lFlags.StringVar(&opts.Identity, identityFlagName, ident, "path to SSH identity file, (CONTAINER_SSHKEY)")
_ = cmd.RegisterFlagCompletionFunc(identityFlagName, completion.AutocompleteDefault)
+ lFlags.BoolVar(&opts.NoOut, "noout", false, "do not output to stdout")
lFlags.BoolVarP(&opts.Remote, "remote", "r", registry.IsRemote(), "Access remote Podman service")
pFlags := cmd.PersistentFlags()
if registry.IsRemote() {
diff --git a/cmd/podman/utils/error.go b/cmd/podman/utils/error.go
index aab1da675..b3b54876f 100644
--- a/cmd/podman/utils/error.go
+++ b/cmd/podman/utils/error.go
@@ -27,7 +27,7 @@ func (o OutputErrors) PrintErrors() (lastError error) {
instead returns a message and we cast it to a new error.
Following function performs parsing on build error and returns
- exit status which was exepected for this current build
+ exit status which was expected for this current build
*/
func ExitCodeFromBuildError(errorMsg string) (int, error) {
if strings.Contains(errorMsg, "exit status") {
diff --git a/cmd/winpath/main.go b/cmd/winpath/main.go
index 494d1cf3c..6fbe72837 100644
--- a/cmd/winpath/main.go
+++ b/cmd/winpath/main.go
@@ -114,7 +114,7 @@ func addPathToRegistry(dir string) error {
return err
}
-// Removes all occurences of a directory path from the Windows path stored in the registry
+// Removes all occurrences of a directory path from the Windows path stored in the registry
func removePathFromRegistry(path string) error {
k, err := registry.OpenKey(registry.CURRENT_USER, Environment, registry.READ|registry.WRITE)
if err != nil {
@@ -155,7 +155,7 @@ func removePathFromRegistry(path string) error {
return err
}
-// Sends a notification message to all top level windows informing them the environmental setings have changed.
+// Sends a notification message to all top level windows informing them the environmental settings have changed.
// Applications such as the Windows command prompt and powershell will know to stop caching stale values on
// subsequent restarts. Since applications block the sender when receiving a message, we set a 3 second timeout
func broadcastEnvironmentChange() {