Description:
Currently, when users specify a config file with an unsupported extension (e.g., --sqlconfig myfile.txt), they receive a confusing Viper error: "Unsupported Config Type 'txt'".
Proposed Enhancement:
Add validation in internal/config/viper.go to check the file extension before passing to Viper and provide a clearer error message such as:
Error: Configuration files must use YAML format with .yaml or .yml extension.
The file 'myfile.txt' has an unsupported extension '.txt'.
Related:
Implementation Notes:
- Check file extension in
configureViper() or SetFileName() function
- Allow
.yaml, .yml, and no extension (for default ~/.sqlcmd/sqlconfig)
- Provide helpful error message pointing users to documentation
Description:
Currently, when users specify a config file with an unsupported extension (e.g.,
--sqlconfig myfile.txt), they receive a confusing Viper error: "Unsupported Config Type 'txt'".Proposed Enhancement:
Add validation in
internal/config/viper.goto check the file extension before passing to Viper and provide a clearer error message such as:Related:
Implementation Notes:
configureViper()orSetFileName()function.yaml,.yml, and no extension (for default~/.sqlcmd/sqlconfig)