influxdata / influxdata/influx-cli

Add hint to `influx write` if CLI arg isn't valid LP

Open
#222 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
75
Forks
22
PR merge metrics
No merged PRs in 30d

Description

`influx write` supports reading data as a positional arg, or from a file. It's easy for users to get mixed up and accidentally pass a filename as a positional arg, leading to error messages like:
```
Error: failed to write data: 400 Bad Request: unable to parse 'latest-observations.lp': missing fields
```
It'd be nice to add some sort of hint about missing the `--file` flag to the error message, if we can figure out a heuristic for detecting this type of error.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the `influx write` command and trace how positional arguments and file input are parsed and how the shown write error is surfaced. Define and test a reliable heuristic for likely filenames passed as data, then confirm the hint appears only for that case and that normal invalid line-protocol errors remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.