influxdb/cmd/influx
Sam Arnold bf7dddaec5
fix: Add back flux CLI (#20889)
Closes:
https://github.com/influxdata/influxdb/issues/18947
https://github.com/influxdata/influxdb/issues/20852

Similarly to 2.x, the flux CLI now only supports the -execute argument
or commands on stdin. Examples:

```
➜ echo 'import "influxdata/influxdb/v1" v1.databases()' | ./influx -type flux
Result: _result
Table: keys: [organizationID]
 organizationID:string     databaseName:string  retentionPolicy:string         retentionPeriod:int  default:bool         bucketId:string
----------------------  ----------------------  ----------------------  --------------------------  ------------  ----------------------
                                     _internal                 monitor             604800000000000          true
                                      telegraf                 autogen                           0          true
                                            db                 autogen                           0          true

➜ ./influx -type flux -execute 'import "influxdata/influxdb/v1" v1.databases()'
Result: _result
Table: keys: [organizationID]
 organizationID:string     databaseName:string  retentionPolicy:string         retentionPeriod:int  default:bool         bucketId:string
----------------------  ----------------------  ----------------------  --------------------------  ------------  ----------------------
                                     _internal                 monitor             604800000000000          true
                                      telegraf                 autogen                           0          true
                                            db                 autogen                           0          true

➜ ./influx -type flux -execute 'import "influxdata/influxdb/v1"'
Error (500): error in query specification while starting program: this Flux script returns no streaming data. Consider adding a "yield" or invoking streaming functions directly, without performing an assignment
```

Note that tty input is explicitly forbidden, unlike 2.x:

```
➜ ./influx -type flux
Connected to http://localhost:8086 version unknown
InfluxDB shell version: unknown
Interactive flux is not supported. Provide your flux script via stdin or the -execute argument.
```
2021-03-09 09:56:52 -05:00
..
cli fix: Add back flux CLI (#20889) 2021-03-09 09:56:52 -05:00
main.go feat(influxdb): Add test around CLI proxy path 2020-01-22 14:13:25 -08:00