当前位置:网站首页>How can my Haskell program or library find its version number- How can my Haskell program or library find its version number?

How can my Haskell program or library find its version number- How can my Haskell program or library find its version number?

2022-07-06 19:16:00 Superior virtue and weak water

problem :

I would like my cabalised program to have a --version switch. I hope my cabalised The program has a --version Switch .

I would like it to report the same version as is present in the .cabal file. I hope it reports with .cabal The same version exists in the file .

If I have to update the version number separately in my Haskell source code as well as in the .cabal file, I will eventually get them out of sync. If I have to be in my Haskell The source code and .cabal The version number is updated separately in the document , I will eventually make them out of sync .

So, how can my program, while being compiled under cabal, get its version number from the .cabal file? that , How is my program in cabal Compile below , from .cabal Get its version number from the file ?


Solution :

Reference resources : https://stackoom.com/en/question/C8Uc
原网站

版权声明
本文为[Superior virtue and weak water]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131240568904.html