JanDeDobbeleer / aliae

Cross shell and platform alias management
https://aliae.dev
MIT License
73 stars 3 forks source link

Ability to create lists in Env #31

Closed RuiNtD closed 10 months ago

RuiNtD commented 10 months ago

Code of Conduct

What would you like to see changed/added?

The ability to create lists, similar to Path, easily cross-platform, like this:

env:
  - name: USERNAMES
    value: |
      dylan
      steve
      bob ross
# Windows
$Env:USERNAMES = "dylan;steve;bob ross"
# Linux
$Env:USERNAMES = "dylan:steve:boss ross"

Or, with an optional delimeter parameter:

env:
  - name: USERNAMES
    value: |
      dylan
      steve
      bob ross
    delimeter: ","
$Env:USERNAMES = "dylan,steve,bob ross"
JanDeDobbeleer commented 10 months ago

@RuiNtD there's no such thing though. Environment variables are always strings, this is a very specific use-case where I fail to see the use-case for as it assumes you're actually having different env var logic in an application per platform.

RuiNtD commented 10 months ago

There are many applications that take lists of strings, usually paths and usually for configuration, in an ENV like how the OS does with Path. It would just be nice to be able to format them in multiple rows instead of just one.

JanDeDobbeleer commented 10 months ago

Implementing this is actually feasible, I would allow the delimiter to be templatable though.

RuiNtD commented 10 months ago

I mean, I did mention a delimiter option in the original post. Lol

JanDeDobbeleer commented 10 months ago

@RuiNtD I know, and upon re-read I went with that option.