| 20 | static StringFlag directory({"-p", "--path"}, "path to work on", ""); |
| 21 | |
| 22 | int 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 | } |
nothing calls this directly
no test coverage detected