MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / mainGetFileInfo

Function mainGetFileInfo

src/fe-getfileinfo.cc:22–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20static StringFlag directory({"-p", "--path"}, "path to work on", "");
21
22int mainGetFileInfo(int argc, const char* argv[])
23{
24 if (argc == 1)
25 showProfiles("getfileinfo", formats);
26 flags.parseFlagsWithConfigFiles(argc, argv, formats);
27
28 try
29 {
30 auto filesystem = Filesystem::createFilesystemFromConfig();
31 auto dirent = filesystem->getDirent(Path(directory));
32
33 for (const auto& e : dirent->attributes)
34 fmt::print("{}={}\n", e.first, quote(e.second));
35 }
36 catch (const FilesystemException& e)
37 {
38 error("{}", e.message);
39 }
40
41 return 0;
42}

Callers

nothing calls this directly

Calls 7

showProfilesFunction · 0.85
printFunction · 0.85
quoteFunction · 0.85
errorFunction · 0.85
PathClass · 0.50
getDirentMethod · 0.45

Tested by

no test coverage detected