列出Gnat中未使用的文件 [英] List unused files in Gnat
问题描述
我在GNAT中有一个项目,我想列出所有从未使用过的文件。我正在考虑使用python脚本执行此操作,但是,使用GNAT可以轻松做到这一点吗?
I have a project in GNAT and I would like to list all the files that are never used. I am thinking about doing it with a python script, but, is it possible to do so easily with GNAT?
我发现了有关gnatelim的信息,但尽管在帮助中它说有-P选项
I found about gnatelim, but although in the help it says to have the -P option
usage: gnatelim [options] -main=main_unit_name {filename} [-cargs gcc_switches]
options:
--version - Display version and exit
--help - Display usage and exit
-Pproject - Use project file project. Only one such switch can be used.
似乎不起作用,因为它要求一个主要单元(拥有整个项目!) :
It seems that it does not work as it asks for a main unit (having the whole project!):
>gnatelim -Prelease.gpr
gnatelim: No main unit specified
try "gnatelim.exe --help" for more information.
我正在使用GNAT 2015
I am using GNAT 2015
推荐答案
gnatelim
的帮助非常有限,但是我做了一些实验,而窍门似乎是通过了 gnatelim
主机的文件名:
The help for gnatelim
is rather limited, but I have experimented a bit, and the trick seems to be to pass gnatelim
the file name of your main unit:
gnatelim main.adb
如果您的项目比包含所有所需源文件的单个目录更复杂,则可以传递 gnatelim
既是项目文件,也是您主体的文件名:
If your project is more complicated than a single directory containing all needed source files, you pass gnatelim
both a project file and the file name of your main unit:
gnatelim -P black_examples.gpr client.adb
这篇关于列出Gnat中未使用的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!