Skip to content

Instantly share code, notes, and snippets.

@htsign
Created October 25, 2019 17:55
Show Gist options
  • Save htsign/980461940e4a965f795e1ba6b8209b5d to your computer and use it in GitHub Desktop.
Save htsign/980461940e4a965f795e1ba6b8209b5d to your computer and use it in GitHub Desktop.
import os
import strformat
template until(cond: bool, body: untyped): untyped =
while (true):
if cond: break
body
for param in os.commandLineParams():
if os.existsFile(param):
let f: File = open(param, FileMode.fmRead)
defer: f.close
echo fmt"==== ({param}) ===="
until f.endOfFile:
echo f.readLine
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment