-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathfe-format.cc
More file actions
37 lines (32 loc) · 1.07 KB
/
fe-format.cc
File metadata and controls
37 lines (32 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "lib/globals.h"
#include "lib/flags.h"
#include "lib/fluxmap.h"
#include "lib/sector.h"
#include "lib/proto.h"
#include "lib/readerwriter.h"
#include "lib/imagereader/imagereader.h"
#include "lib/imagewriter/imagewriter.h"
#include "lib/fluxsource/fluxsource.h"
#include "lib/decoders/decoders.h"
#include "fluxengine.h"
#include "lib/vfs/sectorinterface.h"
#include "lib/vfs/vfs.h"
#include "lib/usb/usb.h"
#include "src/fileutils.h"
#include <google/protobuf/text_format.h>
#include <fstream>
static FlagGroup flags({&fileFlags});
static StringFlag volumeName({"-n", "--name"}, "volume name", "FluxEngine");
static SettableFlag quick({"-q", "--quick"},
"perform quick format (requires the disk to be previously formatted)");
int mainFormat(int argc, const char* argv[])
{
if (argc == 1)
showProfiles("format", formats);
flags.parseFlagsWithConfigFiles(argc, argv, formats);
auto usb = USB::create();
auto filesystem = Filesystem::createFilesystemFromConfig();
filesystem->create(quick, volumeName);
filesystem->flushChanges();
return 0;
}