]> hydra-www.ietfng.org Git - csdb/commitdiff
cdb:argparse_for_render return options to caller
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sat, 12 Mar 2022 21:06:15 +0000 (21:06 +0000)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sat, 12 Mar 2022 21:06:15 +0000 (21:06 +0000)
cdb

diff --git a/cdb b/cdb
index 8d40dbc86c695b23019a9ed71c1b7748e7852b10..a791c690b5a4c16a7ed46c12d1cd018efe4a0351 100755 (executable)
--- a/cdb
+++ b/cdb
@@ -143,15 +143,16 @@ local function argparse_flag_nul(c)
 end
 
 local function argparse_for_render(c)
-  c:flag("--unescape")
-   :description("Do not escape filenames ($f is $u); likely use --nul, too")
-   :default(false)
-  c:flag("--nul -0")
-   :description("NUL-terminate records ($z is NUL rather than newline)")
-   :default(false)
-  c:option("--format")
+  local f = c:option("--format")
    :description("Output format specifier")
    :default("$e$h  $f$z")
+  local n = c:flag("--nul -0")
+   :description("NUL-terminate records ($z is NUL rather than newline)")
+   :default(false)
+  local u = c:flag("--unescape")
+   :description("Do not escape filenames ($f is $u); likely use --nul, too")
+   :default(false)
+  return f, n, u
 end
 
 local function renderer_for(args)