VeryGoodOpenSource / cli_completion

Completion functionality for Dart Command-Line Interfaces built using CommandRunner. Built by Very Good Ventures. πŸ¦„
https://pub.dev/packages/cli_completion
MIT License
49 stars 4 forks source link

feat: store completions in `$XDG_CONFIG_HOME` instead of `$HOME` #50

Closed mia-recki closed 1 year ago

mia-recki commented 1 year ago

Status

READY/IN DEVELOPMENT/HOLD

Description

A lot of programs write their configuration files directly to their users' $HOME, making the output of ls -la an unmanageable mess.

XDG Base Directory Specification helps with keeping the home directory tidy by providing a convention that well-behaved programs can follow when deciding where to store certain types of files.

This PR introduces an attempt to add dart-cli-completion/ to $XDG_CONFIG_HOME (if set) instead of the top-level home folder. On my machine it results in ~/.config/dart-cli-completion. The behavior remains unchanged for users who have not explicitly set this variable (assuming that they don't care πŸ™‚).

The XDG specification should also be valid for Windows systems, but I'm not familiar enough with Windows to know whether it's a good idea to propagate this change there as well.

Type of Change