petermr / ami3

Integration of cephis and normami code into a single base. Tests will be slimmed down
Apache License 2.0
17 stars 5 forks source link

Allow default values for options and parameters to be externalized #66

Closed remkop closed 4 years ago

remkop commented 4 years ago

Picocli provides a PropertiesDefaultProvider implementation that hopefully fulfills our needs.

Users can create a .ami.properties file in their home directory, and define default values for ami options as well as options of ami subcommands in this file, as follows:

# this is an example ~/.ami.properties file

# for options, the key is the longest option name
cproject = /my/ami/project/123

# For subcommands, prefix with the subcommand name.
ami.assert.directoryname=/my/ami/project/123/assertable/dir

# for positional parameters, the key is the positional parameter’s param label.
ami.clean.<files>=/my/files/to/clean/by/default

Note that amidict is a separate top-level command and would need a separate ~/.amidict.properties file.

remkop commented 4 years ago

The top-level commands ami and amidict now support this functionality.

Reopening: I should add some documentation for this to the ami project README.

petermr commented 4 years ago

Many thanks!

we'll ask the group to try this out.

On Sat, Aug 22, 2020 at 1:12 AM Remko Popma notifications@github.com wrote:

The top-level commands ami and amidict now support this functionality.

Reopening: I should add some documentation for this to the ami project README.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/petermr/ami3/issues/66#issuecomment-678563358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFTCS5AQVKDCR5UX2OD4D3SB4EPFANCNFSM4QHYRCCA .

-- Peter Murray-Rust Founder ContentMine.org and Reader Emeritus in Molecular Informatics Dept. Of Chemistry, University of Cambridge, CB2 1EW, UK

remkop commented 4 years ago

I updated the ami project README.