MCPcopy Create free account
hub / github.com/peak/s5cmd / NewSelectCommand

Function NewSelectCommand

command/select.go:97–268  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95}
96
97func NewSelectCommand() *cli.Command {
98 sharedFlags := []cli.Flag{
99 &cli.StringFlag{
100 Name: "query",
101 Aliases: []string{"e"},
102 Usage: "SQL expression to use to select from the objects",
103 },
104 &cli.StringFlag{
105 Name: "output-format",
106 Usage: "output format of the result (options: json, csv)",
107 },
108 &cli.StringSliceFlag{
109 Name: "exclude",
110 Usage: "exclude objects with given pattern",
111 },
112 &cli.BoolFlag{
113 Name: "force-glacier-transfer",
114 Usage: "force transfer of glacier objects whether they are restored or not",
115 },
116 &cli.BoolFlag{
117 Name: "ignore-glacier-warnings",
118 Usage: "turns off glacier warnings: ignore errors encountered during selecting objects",
119 },
120 &cli.BoolFlag{
121 Name: "raw",
122 Usage: "disable the wildcard operations, useful with filenames that contains glob characters",
123 },
124 &cli.BoolFlag{
125 Name: "all-versions",
126 Usage: "list all versions of object(s)",
127 },
128 &cli.StringFlag{
129 Name: "version-id",
130 Usage: "use the specified version of the object",
131 },
132 }
133
134 cmd := &cli.Command{
135 Name: "select",
136 HelpName: "select",
137 Usage: "run SQL queries on objects",
138 Subcommands: []*cli.Command{
139 {
140 Name: "csv",
141 Usage: "run queries on csv files",
142 Flags: append([]cli.Flag{
143 &cli.StringFlag{
144 Name: "delimiter for the csv file",
145 Usage: "delimiter of the csv file.",
146 Value: ",",
147 },
148 &cli.StringFlag{
149 Name: "use-header",
150 Usage: "use header of the csv file. (options for AWS: IGNORE, NONE, USE)",
151 Value: "NONE",
152 },
153 &cli.StringFlag{
154 Name: "compression",

Callers 1

CommandsFunction · 0.85

Calls 6

printErrorFunction · 0.85
buildSelectFunction · 0.85
commandFromContextFunction · 0.85
getBashCompleteFnFunction · 0.85
StringMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected