10 Commits

Author SHA1 Message Date
9db72b0445 fix: Create errors-file if it does not exist (#520)
When passed `--errors-file`, the file should not
need to already exist on disk to be written into
2023-07-19 06:57:42 -04:00
50de408a0a fix: add mutual exclusion for OrgId and OrgName params (#377)
Display an error when the OrgName and OrgId flags are both passed in. Only one or the other is allowed.

closes https://github.com/influxdata/influx-cli/issues/371
2022-05-13 18:50:22 -06:00
adc58b8441 chore: refactor influxid.ID, cleanup organization checking (#326) 2021-11-10 15:12:59 -06:00
ead44e4e83 fix: downgrade urfave/cli to v1 to enable more flexible parsing (#154) 2021-06-28 14:49:26 -04:00
9747d05ae1 refactor: expose generated code and client business logic to share with Kapacitor (#103)
* refactor: take clients out of internal

* refactor: move stdio to pkg

* Move internal/api to api

* refactor: final changes for Kapacitor to access shared functionality

* chore: regenerate mocks

* fix: bad automated refactor

* chore: extra formatting not caught by make fmt
2021-05-25 10:05:01 -04:00
8e73906437 refactor: replace global slices with functions (#94)
I started to see strange behavior where flags would merge across
subcommands. I'm not sure if the bug was in our 'append' usage or
in urfave/cli's handling of flag-slices, but this change seems to
fix the problem either way.
2021-05-14 16:10:07 -04:00
ead7e63d41 refactor: split flat internal/ module into modules-per-cmd (#64) 2021-05-06 13:47:03 -04:00
3414e1a983 refactor: Move from global state to functions (#53)
This commit represents a few experiments of features I've used in Cobra

1. Uses cli.GenericFlag to encapsulate parsing and validation of flag
   values at parse time. This removes the burden from the individual
   CLI commands to parse and validate args and options.

2. Add influxid.ID that may be used by any flag that requires an
   Influx ID. influxid.ID parses and validates string value is a valid
   ID, removing this burden from individual commands and ensuring valid
   values before the command actions begins.

3. Binds cli.Flags directly to params structures to directly capture
   the values when parsing flags.

4. Moves from global state to local builder functions for the majority
   of the commands. This allows the commands to bind to flag variables
   reducing the repeated ctx.String(), ctx.Int(), etc

5. Leverages the BeforeFunc to create middleware and inject the CLI and
   API client into commands, saving the repeated boilerplate across
   all of the instantiated commands. This is extensible, so additional
   middleware can be appends using the middleware.WithBeforeFns
2021-05-03 09:31:45 -04:00
0b4d753728 feat: port influx bucket commands from influxdb (#54)
* feat: add /buckets and /orgs APIs to codegen
* feat: add bucket CLI commands
* test: add bucket tests
2021-05-03 08:46:53 -04:00
0e1db1e782 feat: port influx write from influxdb (#47) 2021-04-26 12:32:54 -04:00