diff options
author | tdro <tdro@users.noreply.github.com> | 2022-05-10 02:52:16 -0400 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2022-05-10 02:52:16 -0400 |
commit | e957c907a2e9d9d7220cc64c5acbef304bca5cef (patch) | |
tree | 3c7f44466b5e13f153a08be3967e7d34a9f428b5 | |
parent | 1145f2fdff2b252fee99b9a7ae124ba037550699 (diff) | |
download | dotfiles-e957c907a2e9d9d7220cc64c5acbef304bca5cef.tar.gz dotfiles-e957c907a2e9d9d7220cc64c5acbef304bca5cef.tar.bz2 dotfiles-e957c907a2e9d9d7220cc64c5acbef304bca5cef.zip |
.local/bin/plumber: Add 8601 dates
-rwxr-xr-x | .local/bin/plumber | 34 | ||||
-rwxr-xr-x | .local/bin/plumber-dmenu | 1 |
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 |