influxdata / influxdata/influx-cli

influxdb-cli does not follow xdg base directory specification

Open Beginner friendly
#514 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
75
Forks
22
PR merge metrics
No merged PRs in 30d

Description

TLDR; save history to `$HOME/.local/state/influx/history` if `$XDG_STATE_HOME` is not defined otherwise to `$XDG_STATE_HOME/influx/history` instead of `$HOME/influx_history`.

From [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html):
> The XDG Base Directory Specification is based on the following concepts:
> - There is a single base directory relative to which user-specific state data should be written. This directory is defined by the environment variable `$XDG_STATE_HOME`.

> The `$XDG_STATE_HOME` contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in `$XDG_DATA_HOME`. It may contain:
> - actions history (logs, history, recently used files, …)

Looks like relevant lines are around here:
https://github.com/influxdata/influx-cli/blob/3a2e139292fcb3f854ebfbf40f0cf2de90b1b511/clients/v1_shell/v1_shell.go#L153

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in clients/v1_shell/v1_shell.go around line 153, where the CLI history path is handled. Check the XDG_STATE_HOME fallback behavior and confirm that history is saved under $XDG_STATE_HOME/influx/history or $HOME/.local/state/influx/history when the variable is unset, instead of $HOME/influx_history.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.