initial commit
also adds b64d bin
This commit is contained in:
commit
a83b6272f5
4 changed files with 33 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin/
|
6
nim.cfg
Normal file
6
nim.cfg
Normal file
|
@ -0,0 +1,6 @@
|
|||
-d:release
|
||||
--passC:"-flto"
|
||||
--passL:"-flto"
|
||||
--passL:"-s"
|
||||
--opt:speed
|
||||
--passC:"-ffast-math"
|
14
nutils.nimble
Normal file
14
nutils.nimble
Normal 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
12
src/b64d.nim
Normal 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
|
Loading…
Reference in a new issue