Open baijuw opened 1 year ago
I believe file extensions should stay. They are used by the underlying library to detect the file format to support multiple encodings.
If you want to add some stuff to your file name use file name and don't touch file extension
If that is the case, then can the error reporting be improved as of now a non existing config also throws the same error as file extension issue.
The documentation at https://gnmic.openconfig.net/user_guide/configuration_intro/ says that the configuration file format can be JSON, YAML, TOML, HCL, or Properties. By default, gnmic searches for a file named .gnmic.[yml/yaml, toml, json]. This is understandable for discovering the configuration filename when one is not explicitly called out. However, it is not clear that when the --config flag is used, the filename extension must still end with .yml/yaml, toml, json. Additionally, I was hoping that when the configuration filename is provided with the --config flag, the filename extension would not matter at all. However, as of now, something like the following will fail without a clear error message:
Similarly, if I were to provide a non existing filename, it would still fail with the same message. Preferably a File not found would be more apt here.
The only way this works as of now is if we follow the same filename extensions as expected with the default format [yml/yaml, toml, json].
The gnmic version
I am requesting a few changes: