mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
feat(comma): Added help method.
This commit is contained in:
39
src/root.zig
39
src/root.zig
@@ -7,6 +7,38 @@ const Command = comma.Command;
|
||||
|
||||
pub const root: Command = .new(.{
|
||||
.name = "envr",
|
||||
.short = "Manage your .env files.",
|
||||
.long =
|
||||
\\envr keeps your .env synced to a local, age encrypted database.
|
||||
\\It is a safe and eay way to gather all your .env files in one place where they can
|
||||
\\easily be backed by another tool such as restic or git.
|
||||
\\All your data is stored in ~/data.age
|
||||
\\
|
||||
\\Getting started is easy:
|
||||
\\
|
||||
\\1. Create your configuration file and set up encrypted storage:
|
||||
\\
|
||||
\\> envr init
|
||||
\\
|
||||
\\2. Scan for existing .env files:
|
||||
\\
|
||||
\\> envr scan
|
||||
\\
|
||||
\\Select the files you want to back up from the interactive list.
|
||||
\\
|
||||
\\3. Verify that it worked:
|
||||
\\
|
||||
\\> envr list
|
||||
\\
|
||||
\\4. After changing any of your .env files, update the backup with:
|
||||
\\
|
||||
\\> envr sync
|
||||
\\
|
||||
\\5. If you lose a repository, after re-cloning the repo into the same path it was
|
||||
\\at before, restore your backup with:
|
||||
\\
|
||||
\\> envr restore <path to repository> .env
|
||||
,
|
||||
.subcommands = &.{
|
||||
.{
|
||||
.name = "deps",
|
||||
@@ -17,7 +49,10 @@ pub const root: Command = .new(.{
|
||||
\\ The deps command reports which binaries are available and which are not."
|
||||
,
|
||||
},
|
||||
.{ .name = "version" },
|
||||
.{
|
||||
.name = "version",
|
||||
.short = "Show envr's version",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -35,7 +70,7 @@ test "parse version" {
|
||||
}
|
||||
|
||||
test "parse unknown" {
|
||||
const args = &[_][]const u8{"bad", "value"};
|
||||
const args = &[_][]const u8{ "bad", "value" };
|
||||
const cmd = root.parse(args);
|
||||
|
||||
try std.testing.expectEqual(.unknown, cmd);
|
||||
|
||||
Reference in New Issue
Block a user