Add a config file
maybe it can use a system env variable to assign a default repository allowing omitting
Perhaps it's easy enough to apply the variable in a shell script or shell command line that calls conserve? Or, can you tell me more about the use case for this?
TLNR: just for omitting an argument
It's inspired by another backup file tool: "https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html". It uses "RESTIC_REPOSITORY" env as the default backup repository which allows us to omit the repo parameter. For example , in command "conserve backup /backup/home.cons", we need to assign argument "/backup/home.cons". I think it's more convenient if we use "conserve backup" , then the program first checks whether CONSERVE_DEFAULT_REPOSITORY env exists. If CONSERVE_DEFAULT_REPOSITORY has some path then use it as repo, otherwise report an error.
I see. I can see the attraction of just running one command to make a backup: at the moment I have a shell script that I run, but perhaps it'd be a better UX to not need that and have Conserve remember what to do.
Because the repository argument comes first and is an argument rather than a named option, this seems to need some thought about how to change the command-line interface. It might be OK to make the first option optional, but that does get a bit weird, and from memory some commands have more than two arguments, which makes it very ambiguous.
Couple other thoughts:
Maybe environment variables aren't the best way to set a default? They have a somewhat poor UX to set, especially on Windows. Maybe a config file would be better.
Having a single default repository makes more sense if that repo can store multiple independent sources, which is #101.
As well as remembering the repo, maybe Conserve should get the source and exclusions from a configuration file. Then the default invocation could take no arguments, which might be nice. And this would move away from the pattern I have now of effectively configuring it through a wrapper script. Probably the first step on this is to sketch the instructions for using such a system.