summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/build.go2
-rw-r--r--cmd/podman/commands.go8
-rw-r--r--cmd/podman/common.go1
-rw-r--r--cmd/podman/container.go2
-rw-r--r--cmd/podman/exec.go10
-rw-r--r--cmd/podman/image.go9
-rw-r--r--cmd/podman/main.go2
-rw-r--r--cmd/podman/port.go6
-rw-r--r--cmd/podman/ps.go4
-rw-r--r--cmd/podman/refresh.go1
-rw-r--r--cmd/podman/rmi.go4
11 files changed, 34 insertions, 15 deletions
diff --git a/cmd/podman/build.go b/cmd/podman/build.go
index 8ea9e6957..cfeabfb4e 100644
--- a/cmd/podman/build.go
+++ b/cmd/podman/build.go
@@ -53,7 +53,7 @@ func init() {
flags.SetInterspersed(false)
budFlags := buildahcli.GetBudFlags(&budFlagsValues)
- flag := budFlags.Lookup("pull-always")
+ flag := budFlags.Lookup("pull")
flag.Value.Set("true")
flag.DefValue = "true"
layerFlags := buildahcli.GetLayerFlags(&layerValues)
diff --git a/cmd/podman/commands.go b/cmd/podman/commands.go
index fd36e77d5..2f9a9cfe2 100644
--- a/cmd/podman/commands.go
+++ b/cmd/podman/commands.go
@@ -18,7 +18,7 @@ func getMainCommands() []*cobra.Command {
_execCommand,
_generateCommand,
_playCommand,
- _psCommand,
+ &_psCommand,
_loginCommand,
_logoutCommand,
_logsCommand,
@@ -54,6 +54,10 @@ func getImageSubCommands() []*cobra.Command {
// Commands that the local client implements
func getContainerSubCommands() []*cobra.Command {
+
+ var _listSubCommand = _psCommand
+ _listSubCommand.Use = "list"
+
return []*cobra.Command{
_attachCommand,
_checkpointCommand,
@@ -64,8 +68,8 @@ func getContainerSubCommands() []*cobra.Command {
_execCommand,
_exportCommand,
_killCommand,
+ &_listSubCommand,
_logsCommand,
- _psCommand,
_mountCommand,
_pauseCommand,
_portCommand,
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index f9dfa3759..e980e10f9 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -519,7 +519,6 @@ func scrubServer(server string) string {
func UsageTemplate() string {
return `Usage:{{if .Runnable}}
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
-
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
Aliases:
diff --git a/cmd/podman/container.go b/cmd/podman/container.go
index d2450fdd3..338bb005c 100644
--- a/cmd/podman/container.go
+++ b/cmd/podman/container.go
@@ -18,11 +18,13 @@ var containerCommand = cliconfig.PodmanCommand{
// Commands that are universally implemented.
var containerCommands = []*cobra.Command{
_containerExistsCommand,
+ _inspectCommand,
}
func init() {
containerCommand.AddCommand(containerCommands...)
containerCommand.AddCommand(getContainerSubCommands()...)
containerCommand.SetUsageTemplate(UsageTemplate())
+
rootCmd.AddCommand(containerCommand.Command)
}
diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go
index 032262497..4917fb606 100644
--- a/cmd/podman/exec.go
+++ b/cmd/podman/exec.go
@@ -105,5 +105,13 @@ func execCmd(c *cliconfig.ExecValues) error {
envs = append(envs, fmt.Sprintf("%s=%s", k, v))
}
- return ctr.Exec(c.Tty, c.Privileged, envs, cmd, c.User, c.Workdir)
+ streams := new(libpod.AttachStreams)
+ streams.OutputStream = os.Stdout
+ streams.ErrorStream = os.Stderr
+ streams.InputStream = os.Stdin
+ streams.AttachOutput = true
+ streams.AttachError = true
+ streams.AttachInput = true
+
+ return ctr.Exec(c.Tty, c.Privileged, envs, cmd, c.User, c.Workdir, streams)
}
diff --git a/cmd/podman/image.go b/cmd/podman/image.go
index aaa1866c4..b5c1c3ccf 100644
--- a/cmd/podman/image.go
+++ b/cmd/podman/image.go
@@ -15,6 +15,7 @@ var (
},
}
_imagesSubCommand = _imagesCommand
+ _rmSubCommand = _rmiCommand
)
//imageSubCommands are implemented both in local and remote clients
@@ -28,7 +29,6 @@ var imageSubCommands = []*cobra.Command{
_pruneImagesCommand,
_pullCommand,
_pushCommand,
- _rmiCommand,
_saveCommand,
_tagCommand,
}
@@ -38,7 +38,12 @@ func init() {
imageCommand.AddCommand(imageSubCommands...)
imageCommand.AddCommand(getImageSubCommands()...)
- _imagesSubCommand.Aliases = []string{"ls", "list"}
+ // Setup of "images" to appear as "list"
+ _imagesSubCommand.Use = "list"
+ _imagesSubCommand.Aliases = []string{"ls"}
imageCommand.AddCommand(&_imagesSubCommand)
+ // Setup of "rmi" to appears as "rm"
+ _rmSubCommand.Use = "rm"
+ imageCommand.AddCommand(&_rmSubCommand)
}
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index d36270853..98e2f23ca 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -47,7 +47,7 @@ var mainCommands = []*cobra.Command{
podCommand.Command,
_pullCommand,
_pushCommand,
- _rmiCommand,
+ &_rmiCommand,
_saveCommand,
_tagCommand,
_versionCommand,
diff --git a/cmd/podman/port.go b/cmd/podman/port.go
index 1c3086536..ffb5749fb 100644
--- a/cmd/podman/port.go
+++ b/cmd/podman/port.go
@@ -128,9 +128,6 @@ func portCmd(c *cliconfig.PortValues) error {
if state, _ := con.State(); state != libpod.ContainerStateRunning {
continue
}
- if c.All {
- fmt.Println(con.ID())
- }
portmappings, err := con.PortMappings()
if err != nil {
@@ -143,6 +140,9 @@ func portCmd(c *cliconfig.PortValues) error {
if hostIP == "" {
hostIP = "0.0.0.0"
}
+ if c.All {
+ fmt.Printf("%s\t", con.ID()[:12])
+ }
// If not searching by port or port/proto, then dump what we see
if port == "" {
fmt.Printf("%d/%s -> %s:%d\n", v.ContainerPort, v.Protocol, hostIP, v.HostPort)
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 3bc4f0b08..fe4173fdd 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -157,7 +157,7 @@ func (a psSortedSize) Less(i, j int) bool {
var (
psCommand cliconfig.PsValues
psDescription = "Prints out information about the containers"
- _psCommand = &cobra.Command{
+ _psCommand = cobra.Command{
Use: "ps",
Short: "List containers",
Long: psDescription,
@@ -173,7 +173,7 @@ var (
)
func init() {
- psCommand.Command = _psCommand
+ psCommand.Command = &_psCommand
psCommand.SetUsageTemplate(UsageTemplate())
flags := psCommand.Flags()
flags.BoolVarP(&psCommand.All, "all", "a", false, "Show all the containers, default is only running containers")
diff --git a/cmd/podman/refresh.go b/cmd/podman/refresh.go
index 641748452..193be6953 100644
--- a/cmd/podman/refresh.go
+++ b/cmd/podman/refresh.go
@@ -26,6 +26,7 @@ var (
)
func init() {
+ _refreshCommand.Hidden = true
refreshCommand.Command = _refreshCommand
refreshCommand.SetUsageTemplate(UsageTemplate())
}
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index e5bb9b486..5b8bf1ea3 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -14,7 +14,7 @@ import (
var (
rmiCommand cliconfig.RmiValues
rmiDescription = "Removes one or more locally stored images."
- _rmiCommand = &cobra.Command{
+ _rmiCommand = cobra.Command{
Use: "rmi [flags] IMAGE [IMAGE...]",
Short: "Removes one or more images from local storage",
Long: rmiDescription,
@@ -30,7 +30,7 @@ var (
)
func init() {
- rmiCommand.Command = _rmiCommand
+ rmiCommand.Command = &_rmiCommand
rmiCommand.SetUsageTemplate(UsageTemplate())
flags := rmiCommand.Flags()
flags.BoolVarP(&rmiCommand.All, "all", "a", false, "Remove all images")