[Feature Request] Structure .driverc
jean-christophe-manciot opened this issue ยท 7 comments
[global]
key1=value1
key2=value21
[command_1] # such as pull
key3=value31,value32
key4
key5=value51
[command_2] # such as share
key3=value33
key2=value22
key6=value61,value62,value63
...
where the global keys apply until the same keys (options) are overridden by more specific values in [command_n] sections.
Then it's much easier to perform some repetitive commands.
Hello there @jean-christophe-manciot, thank you for the feature request and for the patience.
I've been very busy but this evening I found time to work on this issue and I'll be pushing up a
PR very soon.
I think this is a very useful feature and I'll be using it quite a lot myself. Thank you!
Nice ;)
I've read structured/sectioned .driverc configuration: I feel there might be a potential issue if the user inadvertently positions the [global] section below another [<command>] section: The options in the global section could override more specific ones, couldn't they?.
@jean-christophe-manciot it doesn't matter actually, placing a command below the other only overwrites if those commands are the same, otherwise we follow the overwriting precedence
mentioned ie [definedNamespace] > [global].
For example:
[global]
depth=10
[global]
depth=-1
[global]
depth=1
the depth in namespace global will be 1 at the end. That's different from
[push]
depth=12
[global]
depth=1
[global]
depth=3
the depth in namespace global will be 3 at the end, the depth in namespace push will be 12
Also, are only <key>=<value> lines supported, or can we mimic all options available on the CLI?
For instance:
[share]
emails=drive-mailing-list@gmail.com,odeke@ualberta.ca message="Here is the drive code" role=reader,commenter type=user
[diff]
skip-content-check
@jean-christophe-manciot on a side note, thank you very much for your contributions! I made a release and gave you a shoutout, that's the least I could do https://github.com/odeke-em/drive/releases/tag/v0.3.9.
In regards to your request in #778 (comment), that'd be nice. Please file an issue and we'll put it on the plate for v0.4.0 as an enhancement.