aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/plumber34
-rwxr-xr-x.local/bin/plumber-dmenu1
2 files changed, 25 insertions, 10 deletions
diff --git a/.local/bin/plumber b/.local/bin/plumber
index 4483708..e2c9911 100755
--- a/.local/bin/plumber
+++ b/.local/bin/plumber
@@ -13,16 +13,17 @@ defmodule ArgParser do
|> OptionParser.parse!(strict: [option: :string, text: :string])
options = [
- camelize: "text->camelize",
- dictionary: "word->dictionary",
- first_letter: "text->first-letter-words",
- kjv_lookup: "verse->kjv",
- lorem_paragraph: "lorem->paragraph",
- lorem_title: "lorem->title",
- lower_case: "case->lower",
- single_line: "text->single-line",
- slugize: "text->slugize",
- title_case: "case->title",
+ camelize: "text->camelize",
+ date8601: "text->date8601",
+ dictionary: "word->dictionary",
+ first_letter: "text->first-letter-words",
+ kjv_lookup: "verse->kjv",
+ lorem_paragraph: "lorem->paragraph",
+ lorem_title: "lorem->title",
+ lower_case: "case->lower",
+ single_line: "text->single-line",
+ slugize: "text->slugize",
+ title_case: "case->title",
title_case_strict: "case->title-strict"
]
@@ -73,6 +74,9 @@ defmodule ArgParser do
opts[:option] == options[:lorem_paragraph] ->
TextPlumber.loremParagraph()
+ opts[:option] == options[:date8601] ->
+ TextPlumber.date8601()
+
opts[:option] == options[:kjv_lookup] ->
System.cmd(Settings.terminal(), [
"-e",
@@ -136,6 +140,16 @@ defmodule TextPlumber do
"dict -h localhost #{TextPlumber.firstWordOf(text)} 2>&1 | vim -"
])
end
+
+ def date8601() do
+ {string, _return} =
+ System.cmd("date", [
+ "--universal",
+ "--iso-8601=seconds"
+ ])
+
+ IO.puts(string)
+ end
end
ArgParser.parse()
diff --git a/.local/bin/plumber-dmenu b/.local/bin/plumber-dmenu
index 07e0488..262d099 100755
--- a/.local/bin/plumber-dmenu
+++ b/.local/bin/plumber-dmenu
@@ -1,6 +1,7 @@
#!/bin/sh -eu
options="\
text->camelize
+text->date8601
word->dictionary
text->first-letter-words
verse->kjv