Skip to content

Commit 4589322

Browse files
committed
🐛 Fix arg == nil in pandoc
1 parent dc9fa05 commit 4589322

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lua/prompt/utils.lua

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ local M = {}
77
---@return table
88
function M.get_parser()
99
-- Define the command-line argument parser.
10-
10+
local name
11+
if arg and arg[0] then
12+
name = arg[0]:gsub(".*/", "")
13+
else
14+
name = prompt.name .. "p"
15+
end
1116
local parser = argparse()
12-
:name(arg[0]:gsub(".*/", ""))
17+
:name(name)
1318
:description "A Lua command prompt with pretty-printing and auto-completion."
1419
:add_help "-h"
1520
:add_complete({ hidden = true })

0 commit comments

Comments
 (0)