Skip to content

Commit

Permalink
feat: add help messages
Browse files Browse the repository at this point in the history
feat(goget): add help message

feat(gomod): add help message
  • Loading branch information
olexsmir committed Jun 24, 2022
1 parent 0b415c3 commit 096bc8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/gopher/goget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ local u = require "gopher._utils"
---run "go get"
return function(...)
local args = { ... }
if #args == 0 then
u.notify("please provide a package url to get", "error")
return
end

for i, arg in ipairs(args) do
local m = string.match(arg, "^https://(.*)$") or string.match(arg, "^http://(.*)$") or arg
table.remove(args, i)
Expand Down
5 changes: 5 additions & 0 deletions lua/gopher/gomod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ local u = require "gopher._utils"
---run "go mod"
return function(...)
local args = { ... }
if #args == 0 then
u.notify("please provide any mod command", "error")
return
end

local cmd_args = vim.list_extend({ "mod" }, args)

Job
Expand Down

0 comments on commit 096bc8e

Please sign in to comment.