-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathusage_ps.go
42 lines (33 loc) · 851 Bytes
/
usage_ps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"flag"
"os"
)
const (
DescriptionPsCommand = "List containers"
)
type PsCommand struct {
fs *flag.FlagSet
all string
external string
quiet bool
}
func NewPsCommand() *PsCommand {
gc := &PsCommand{
fs: flag.NewFlagSet("ps", flag.ExitOnError),
}
gc.fs.StringVar(&gc.all, "a", "all", "Show all the containers, default is only running containers")
gc.fs.StringVar(&gc.external, "external", "", "Show containers in storage not controlled by Podman")
gc.fs.BoolVar(&gc.quiet, "q", false, "Print the numeric IDs of the containers only")
gc.fs.Usage = displayUsage(gc.fs, os.Stdout, DescriptionPsCommand, "ps")
return gc
}
func (g *PsCommand) Name() string {
return g.fs.Name()
}
func (g *PsCommand) Init(args []string) error {
return g.fs.Parse(args)
}
func (g *PsCommand) Run() error {
return nil
}