Изменение имени проекта
This commit is contained in:
parent
7714bc498e
commit
cc1a81261a
16 changed files with 70 additions and 70 deletions
24
source/app.d
24
source/app.d
|
@ -1,14 +1,14 @@
|
|||
import snapd;
|
||||
import snag;
|
||||
import commandr;
|
||||
import std.file;
|
||||
|
||||
import core.stdc.stdlib : EXIT_SUCCESS, EXIT_FAILURE;
|
||||
|
||||
private string programName = "snapd";
|
||||
private string programName = "snag";
|
||||
|
||||
int main(string[] args)
|
||||
{
|
||||
auto argumets = new Program(programName, snapdVersion)
|
||||
auto argumets = new Program(programName, snagVersion)
|
||||
.add(new Command("init", "Initializing the repository for storing snapshots"))
|
||||
.add(new Command("status", "Checking the status of tracked files"))
|
||||
.add(new Command("create", "Create a new backup"))
|
||||
|
@ -21,31 +21,31 @@ int main(string[] args)
|
|||
)
|
||||
.parse(args);
|
||||
|
||||
string configFile = argumets.option("config", "snapd.json");
|
||||
string configFile = argumets.option("config", "snag.json");
|
||||
|
||||
SnapdConfig config;
|
||||
SnagConfig config;
|
||||
|
||||
try {
|
||||
config = new SnapdConfig(configFile);
|
||||
} catch (SnapdConfigException e) {
|
||||
config = new SnagConfig(configFile);
|
||||
} catch (SnagConfigException e) {
|
||||
e.print();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
auto snapd = new Snapd(config);
|
||||
auto snag = new Snag(config);
|
||||
|
||||
try {
|
||||
argumets
|
||||
.on("init", (init) {
|
||||
snapd.initialize();
|
||||
snag.initialize();
|
||||
})
|
||||
.on("status", (status) {
|
||||
snapd.status();
|
||||
snag.status();
|
||||
})
|
||||
.on("create", (create) {
|
||||
snapd.create();
|
||||
snag.create();
|
||||
});
|
||||
} catch (SnapdException e) {
|
||||
} catch (SnagException e) {
|
||||
e.print();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue