initial commit

also adds b64d bin
This commit is contained in:
Rasmus Moorats 2023-09-29 17:09:31 +03:00
commit a83b6272f5
Signed by: xx
GPG key ID: FE14255A6AE7241C
4 changed files with 33 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
bin/

6
nim.cfg Normal file
View file

@ -0,0 +1,6 @@
-d:release
--passC:"-flto"
--passL:"-flto"
--passL:"-s"
--opt:speed
--passC:"-ffast-math"

14
nutils.nimble Normal file
View file

@ -0,0 +1,14 @@
# Package
version = "0.1.0"
author = "Rasmus Moorats"
description = "Helper utils I use in the terminal"
license = "MIT"
srcDir = "src"
bin = @["b64d"]
binDir = "bin"
# Dependencies
requires "nim >= 2.0.0"

12
src/b64d.nim Normal file
View file

@ -0,0 +1,12 @@
import std/[base64, os]
var params = commandLineParams()
if params.len == 0:
# todo: combine multiple lines into one
# for when the base64 is wrapped
params = @[stdin.readLine]
for encoded in params:
stdout.write encoded.decode
if params.len != 1: stdout.write "\n"
stdout.flushFile