Skip to content

Tilde in file path (~) is not expanded to the user's home directory #304

@mcbrineellis

Description

@mcbrineellis

When passing a file path that includes a tilde (~) such as --config-file "~/config.toml", the CLI tool treats the tilde as a literal folder name rather than expanding it to $HOME.

As a result, zabbix-cli attempts to read/write in ./~/config.toml instead of /home/USER/config.toml.

Expected behavior:

The CLI should expand ~ to the user's home directory, consistent with shell behavior.

Workaround:

Using $HOME/myconfig.yaml works as expected.

connor@con-air ~ % zabbix-cli init --url "https://zabbix.csilo.ca" --config-file "$HOME/config.toml"
! Configuration file created: /Users/connor/config.toml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions