nfdi4plants / ARCCommander

Tool to manage your ARCs
MIT License
11 stars 9 forks source link

[Feature request] Let "update" do "register" if item does not exist. #44

Closed Brilator closed 2 years ago

Brilator commented 3 years ago

For example if a publication does not exist, I would suggest that an update would just initiate a registration, e.g. let

arc i publication update -d 2021_ARC05_Pub01tmp --title "Review on yeast P09 protein and its involvement
 in redox susceptibility"

do:

arc i publication register -d 2021_ARC05_Pub01tmp --title "Review on yeast P09 protein and its involvement
 in redox susceptibility"
HLWeil commented 3 years ago

Hey,

Yes that's a good idea, however I think the user should have control about this. E.g. a --force / -f or a --addifmissing flag might be added to the arguments.

What do you think, @Brilator?

HLWeil commented 3 years ago

I added such a --addifmissing flag in 1825606685d3b5bda083a02e5399882e5ae8005f. Making use of this flag is kind of a proactive move, possibly preventing loss of changes to be made. Some kind of reactive capability seems sensible too, in order to make the program a little bit more forgiving towards mistakes. Maybe some kind of y/n cli query. Alternatively the planned addition of a logger library might do the trick too.