totptool/cmds/ls.nim

15 lines
267 B
Nim

import algorithm
import os
import strutils
const lsUsage* =
"""Usage: totptool ls
Shows all of the totp codes available.
"""
proc ls*(root: string, args: seq[string]) =
for file in walkFiles root / "*":
var name = file.split("/")
echo name.reversed[0]