You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After implementing Configurable<FooConfig> for FooCommand to have config_path return the application's config path (and tweaking things so this is actually called, see #79 for notes on my confusion), my application exits with a hard error if a config file does not exist at the supplied path.
Ideally I would like the application to attempt to load a config from a supplied path, or use a set of defaults if that file doesn't exist.
The config_path documentation doesn't give details, but is it the responsibility of the config_path function to check whether the file exists and return None if not, or should it return the expected path for a config file, and have the config loading logic have responsibility for gracefully handling the case where the config is not supplied?
The text was updated successfully, but these errors were encountered:
This is a gross oversight in abscissa::command::EntryPoint. My apologies.
I agree it should attempt to source config_path from the underlying toplevel command it wraps unless one is provided explicitly as a command-line argument.
The intention is definitely that you can simply supply a path to load without checking it exists, and the framework will handle the file's absence by printing an error. If you would like to print a custom error rather than letting the framework handle it, you can check for the file's existence in advance (however note you won't get called in the event -c is passed).
After implementing
Configurable<FooConfig> for FooCommand
to haveconfig_path
return the application's config path (and tweaking things so this is actually called, see #79 for notes on my confusion), my application exits with a hard error if a config file does not exist at the supplied path.Ideally I would like the application to attempt to load a config from a supplied path, or use a set of defaults if that file doesn't exist.
The
config_path
documentation doesn't give details, but is it the responsibility of theconfig_path
function to check whether the file exists and returnNone
if not, or should it return the expected path for a config file, and have the config loading logic have responsibility for gracefully handling the case where the config is not supplied?The text was updated successfully, but these errors were encountered: