Commit ab43df5

xxwhirlpool  ·  2026-09-27 16:41:02 -0400 EDT
parent c2b178f
add support for different file exts in paste.rb
1 files changed,  +5, -1
+5, -1
......@@ -2,8 +2,12 @@
22
33 require "tempfile"
44
5+# provide file ext thru arg
6+# if not provided it's .txt
7+ext = ARGV[0] || "txt"
8+
59 # define tmpfile
6-tmp = Tempfile.create("pico-pastes-")
10+tmp = Tempfile.create(["pico-pastes-", ".#{ext}"])
711 tmpfp = tmp.path
812
913 # use $EDITOR, if empty use `nano`