This commit is contained in:
Alexander Zhirov 2025-05-28 00:23:27 +03:00
parent c65b18a915
commit 016455d8f2
Signed by: alexander
GPG key ID: C8D8BE544A27C511
2 changed files with 38 additions and 1 deletions

View file

@ -21,6 +21,23 @@ int main(string[] args)
.optional .optional
) )
) )
.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("status", "Checking the status of tracked files"))
.add(new Command("diff", "Show changed data")) .add(new Command("diff", "Show changed data"))
.add(new Command("import", "Import snapshot from a tar.gz archive") .add(new Command("import", "Import snapshot from a tar.gz archive")
@ -160,6 +177,26 @@ int main(string[] args)
i.option("author", ""), i.option("author", ""),
i.option("email", "") i.option("email", "")
) )
)
.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) { } catch (SnagException e) {
e.print(); e.print();

View file

@ -1,3 +1,3 @@
module snag.version_; module snag.version_;
enum snagVersion = "0.0.10"; enum snagVersion = "0.0.11";