gen -> newSecret
This commit is contained in:
parent
1ab7cb324a
commit
979376a63e
|
@ -7,20 +7,20 @@ import random
|
|||
import strutils
|
||||
import uri
|
||||
|
||||
const genUsage =
|
||||
"""Usage: totptool gen <name>
|
||||
const newSecretUsage =
|
||||
"""Usage: totptool newSecret <name>
|
||||
|
||||
This will generate a new secret and recovery codes
|
||||
This will newSecreterate a new secret and recovery codes
|
||||
for a given service name. This will then write it
|
||||
to your configured secret store and make it
|
||||
available for `totptool code` instantly.
|
||||
"""
|
||||
|
||||
proc help*() =
|
||||
echo genUsage
|
||||
echo newSecretUsage
|
||||
quit 2
|
||||
|
||||
proc gen*(root: string, args: seq[string]) =
|
||||
proc newSecret*(root: string, args: seq[string]) =
|
||||
if args.len != 1:
|
||||
quit "I need a machine name"
|
||||
|
|
@ -3,7 +3,7 @@ import parseopt2
|
|||
|
||||
# Subcommands
|
||||
import cmds/code
|
||||
import cmds/gen
|
||||
import cmds/newSecret
|
||||
import cmds/ls
|
||||
|
||||
const usageHelp =
|
||||
|
@ -18,7 +18,7 @@ Subcommands:
|
|||
code <name>
|
||||
Generate a two-factor auth code for <name>
|
||||
|
||||
gen <name>
|
||||
newSecret <name>
|
||||
Generate a new two-factor auth secret for
|
||||
<name>
|
||||
|
||||
|
@ -56,7 +56,7 @@ for kind, key, val in getopt():
|
|||
of "help", "h":
|
||||
case command
|
||||
of "code": code.help()
|
||||
of "gen": gen.help()
|
||||
of "newSecretSecret": newSecret.help()
|
||||
of "ls": ls.help()
|
||||
else:
|
||||
writeHelp()
|
||||
|
@ -78,7 +78,7 @@ if not existsDir(totpRoot):
|
|||
|
||||
case command
|
||||
of "code": code totpRoot, args
|
||||
of "gen": gen totpRoot, args
|
||||
of "newSecretSecret": newSecret totpRoot, args
|
||||
of "ls": ls totpRoot, args
|
||||
else:
|
||||
echo "Command " & command & " not found."
|
||||
|
|
Loading…
Reference in New Issue