| 13 | static StringFlag filename({"-p", "--path"}, "directory to create", ""); |
| 14 | |
| 15 | int mainMkDir(int argc, const char* argv[]) |
| 16 | { |
| 17 | if (argc == 1) |
| 18 | showProfiles("mkdir", formats); |
| 19 | flags.parseFlagsWithConfigFiles(argc, argv, formats); |
| 20 | |
| 21 | try |
| 22 | { |
| 23 | auto filesystem = Filesystem::createFilesystemFromConfig(); |
| 24 | |
| 25 | Path path(filename); |
| 26 | if (path.size() == 0) |
| 27 | error("filename missing"); |
| 28 | |
| 29 | filesystem->createDirectory(path); |
| 30 | filesystem->flushChanges(); |
| 31 | } |
| 32 | catch (const FilesystemException& e) |
| 33 | { |
| 34 | error("{}", e.message); |
| 35 | } |
| 36 | |
| 37 | return 0; |
| 38 | } |
nothing calls this directly
no test coverage detected