totptool/cmds/ls.nim

19 lines
306 B
Nim

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