-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
local M = {} | ||
|
||
function M.input_args() | ||
return function() | ||
local argument_string = vim.fn.input("Program arg(s) (enter nothing to leave it null): ") | ||
return vim.fn.split(argument_string, " ", true) | ||
end | ||
local argument_string = vim.fn.input("Program arg(s) (enter nothing to leave it null): ") | ||
return vim.fn.split(argument_string, " ", true) | ||
end | ||
|
||
function M.input_exec_path() | ||
return function() | ||
return vim.fn.input('Path to executable (default to "progout"): ', vim.fn.getcwd() .. "/progout", "file") | ||
end | ||
return vim.fn.input('Path to executable (default to "progout"): ', vim.fn.getcwd() .. "/progout", "file") | ||
end | ||
|
||
function M.get_env() | ||
return function() | ||
local variables = {} | ||
for k, v in pairs(vim.fn.environ()) do | ||
table.insert(variables, string.format("%s=%s", k, v)) | ||
end | ||
return variables | ||
local variables = {} | ||
for k, v in pairs(vim.fn.environ()) do | ||
table.insert(variables, string.format("%s=%s", k, v)) | ||
end | ||
return variables | ||
end | ||
|
||
return M | ||
return setmetatable({}, { | ||
__index = function(_, key) | ||
return function() | ||
return function() | ||
return M[key]() | ||
end | ||
end | ||
end, | ||
}) |