mirror of
https://github.com/sbrow/envr.git
synced 2026-08-26 09:53:32 -04:00
refactor: Declared commands with named fields instead of positional.
This commit is contained in:
@@ -68,82 +68,79 @@ GLOBAL_FLAGS: bit_set[Flag_Type] = {.Help, .Config_File, .Color}
|
|||||||
|
|
||||||
COMMANDS := []CommandInfo {
|
COMMANDS := []CommandInfo {
|
||||||
{
|
{
|
||||||
"init",
|
name = "init",
|
||||||
"envr init",
|
usage = "envr init",
|
||||||
"Set up envr",
|
short = "Set up envr",
|
||||||
`The init command generates your initial config and saves it to
|
long = `The init command generates your initial config and saves it to
|
||||||
~/.envr/config in JSON format.\n\nDuring setup, you will be prompted to select one or more ssh keys with which to
|
~/.envr/config in JSON format.\n\nDuring setup, you will be prompted to select one or more ssh keys with which to
|
||||||
encrypt your databse. **Make 100% sure** that you have **a remote copy** of this
|
encrypt your databse. **Make 100% sure** that you have **a remote copy** of this
|
||||||
key somewhere, otherwise your data could be lost forever.`,
|
key somewhere, otherwise your data could be lost forever.`,
|
||||||
{},
|
flags = GLOBAL_FLAGS + {.Force},
|
||||||
GLOBAL_FLAGS + {.Force},
|
|
||||||
{},
|
|
||||||
},
|
|
||||||
{"scan", "envr scan", "Find and select .env files for backup", "", {}, GLOBAL_FLAGS, {}},
|
|
||||||
{
|
|
||||||
"sync",
|
|
||||||
"envr sync",
|
|
||||||
"Update or restore your env backups",
|
|
||||||
"",
|
|
||||||
{},
|
|
||||||
GLOBAL_FLAGS + {.Output},
|
|
||||||
{},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"backup",
|
name = "scan",
|
||||||
"envr backup <path>",
|
usage = "envr scan",
|
||||||
"Import a .env file into envr",
|
short = "Find and select .env files for backup",
|
||||||
"",
|
flags = GLOBAL_FLAGS,
|
||||||
{"add"},
|
|
||||||
GLOBAL_FLAGS,
|
|
||||||
{{name = "path", completion = "untracked-paths"}},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"restore",
|
name = "sync",
|
||||||
"envr restore <path>",
|
usage = "envr sync",
|
||||||
"Restore a .env file from the database",
|
short = "Update or restore your env backups",
|
||||||
"",
|
flags = GLOBAL_FLAGS + {.Output},
|
||||||
{},
|
|
||||||
GLOBAL_FLAGS,
|
|
||||||
{{name = "path", completion = "tracked-paths"}},
|
|
||||||
},
|
|
||||||
{"list", "envr list", "View your tracked files", "", {}, GLOBAL_FLAGS + {.Output}, {}},
|
|
||||||
{
|
|
||||||
"remove",
|
|
||||||
"envr remove <path>",
|
|
||||||
"Remove a .env file from your database",
|
|
||||||
"",
|
|
||||||
{},
|
|
||||||
GLOBAL_FLAGS,
|
|
||||||
{{name = "path", completion = "tracked-paths"}},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"check",
|
name = "backup",
|
||||||
"envr check [path]",
|
usage = "envr backup <path>",
|
||||||
"Check if files are backed up",
|
short = "Import a .env file into envr",
|
||||||
"",
|
aliases = {"add"},
|
||||||
{},
|
flags = GLOBAL_FLAGS,
|
||||||
GLOBAL_FLAGS,
|
args = {{name = "path", completion = "untracked-paths"}},
|
||||||
{{name = "path", optional = true}},
|
|
||||||
},
|
|
||||||
{"version", "envr version", "Show envr's version", "", {}, {.Help}, {}},
|
|
||||||
{
|
|
||||||
"edit-config",
|
|
||||||
"envr edit-config",
|
|
||||||
"Edit your config with your default editor",
|
|
||||||
"",
|
|
||||||
{},
|
|
||||||
GLOBAL_FLAGS,
|
|
||||||
{},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nushell-completion",
|
name = "restore",
|
||||||
"envr nushell-completion",
|
usage = "envr restore <path>",
|
||||||
"Generate custom completions for nushell",
|
short = "Restore a .env file from the database",
|
||||||
"",
|
flags = GLOBAL_FLAGS,
|
||||||
{},
|
args = {{name = "path", completion = "tracked-paths"}},
|
||||||
{.Help},
|
},
|
||||||
{},
|
{
|
||||||
|
name = "list",
|
||||||
|
usage = "envr list",
|
||||||
|
short = "View your tracked files",
|
||||||
|
flags = GLOBAL_FLAGS + {.Output},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "remove",
|
||||||
|
usage = "envr remove <path>",
|
||||||
|
short = "Remove a .env file from your database",
|
||||||
|
flags = GLOBAL_FLAGS,
|
||||||
|
args = {{name = "path", completion = "tracked-paths"}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "check",
|
||||||
|
usage = "envr check [path]",
|
||||||
|
short = "Check if files are backed up",
|
||||||
|
flags = GLOBAL_FLAGS,
|
||||||
|
args = {{name = "path", optional = true}},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "version",
|
||||||
|
usage = "envr version",
|
||||||
|
short = "Show envr's version",
|
||||||
|
flags = {.Help},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "edit-config",
|
||||||
|
usage = "envr edit-config",
|
||||||
|
short = "Edit your config with your default editor",
|
||||||
|
flags = GLOBAL_FLAGS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "nushell-completion",
|
||||||
|
usage = "envr nushell-completion",
|
||||||
|
short = "Generate custom completions for nushell",
|
||||||
|
flags = {.Help},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user