Допилено
This commit is contained in:
parent
573f1d7d51
commit
bb58bfe030
4 changed files with 154 additions and 25 deletions
39
source/app.d
39
source/app.d
|
@ -21,7 +21,23 @@ int main(string[] args)
|
|||
.optional
|
||||
)
|
||||
)
|
||||
.add(new Command("retracking", "Tracking rules update"))
|
||||
.add(new Command("rules", "Tracking rules")
|
||||
.add(new Command("update", "Update rules")
|
||||
.add(new Flag("r", "remove", "Removing from tracking the found ignored files")
|
||||
.name("remove")
|
||||
.optional
|
||||
)
|
||||
)
|
||||
.add(new Command("reset", "Reset rules (restores rules to pre-change state)"))
|
||||
.add(new Command("clear", "Clear rules"))
|
||||
.add(new Command("save", "Save rules"))
|
||||
.add(new Command("show", "Show rules")
|
||||
.add(new Flag("c", "config", "Show rules from the configuration file")
|
||||
.name("config")
|
||||
.optional
|
||||
)
|
||||
)
|
||||
)
|
||||
.add(new Command("status", "Checking the status of tracked files"))
|
||||
.add(new Command("diff", "Show changed data"))
|
||||
.add(new Command("import", "Import snapshot from a tar.gz archive")
|
||||
|
@ -162,8 +178,25 @@ int main(string[] args)
|
|||
i.option("email", "")
|
||||
)
|
||||
)
|
||||
.on("retracking", e =>
|
||||
(new SnagRules(config)).create()
|
||||
.on("rules", (r) {
|
||||
auto rules = new SnagRules(config);
|
||||
r
|
||||
.on("update", update =>
|
||||
rules.update(update.flag("remove"))
|
||||
)
|
||||
.on("reset", reset =>
|
||||
rules.reset()
|
||||
)
|
||||
.on("clear", clear =>
|
||||
rules.clear()
|
||||
)
|
||||
.on("save", clear =>
|
||||
rules.save()
|
||||
)
|
||||
.on("show", show =>
|
||||
rules.show(show.flag("config"))
|
||||
);
|
||||
}
|
||||
);
|
||||
} catch (SnagException e) {
|
||||
e.print();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue