Global --ignore-file or even in-tree .resticignore file support?

I wrote convenience shell wrappers around restic but unfortunately specifying:

restic --ignore-file ~/.resticignore “$@”

doesn’t work since some subcommands don’t support ignore-file. It would be a bit of work to only add this option to subcommands that support it. I think it’s important for me to ensure it’s enabled so there is consistency between commands like backup, rewrite, etc…

Another option I can think of that kopia supports is to allow for .resticignore files in trees similar to gitignore files. I think this should help solve the issue and others may find this amenable for their use-cases as well?

If you don’t use such subcommands that don’t support that flag too often, you could add an bash alias like alias resticnoignorefile=/usr/bin/restic. Then you would first enter your restic command and if it fails you just change the first part of the command…

Or you change your shell wrapper to check the error message of restic and if it says “unsupported flag”, execute /usr/bin/restic again "$@" again?