Skip to content

fix: config file key credential-command not recognized (underscore works, hyphen doesn't) #84

@cboone

Description

@cboone

Summary

The CLI flag --credential-command uses a hyphen, but the corresponding config file key only works as credential_command (underscore). The hyphenated form credential-command in ~/.config/fm/config.yaml is silently ignored.

Steps to reproduce

# ~/.config/fm/config.yaml
# This does NOT work:
credential-command: "security find-generic-password -s fm -a fm -w"

# This works:
credential_command: "security find-generic-password -s fm -a fm -w"
# With hyphen form in config:
fm session
# Error: no token configured

# With underscore form in config:
fm session
# Success: Username: cboone@fea.st

Expected behavior

The config file should accept the same key name as the CLI flag (credential-command with a hyphen), or both forms should be accepted.

This is likely a Viper/Cobra configuration binding issue where SetConfigName doesn't normalize hyphens to underscores (or vice versa) when reading the YAML file.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions