mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-25 17:04:50 +01:00
feat: improved login command
generates random username, default password but whatever server is going to do a real check eventually
This commit is contained in:
parent
fb706706dd
commit
21dbc36d01
1 changed files with 4 additions and 1 deletions
|
@ -19,7 +19,10 @@ vim.api.nvim_create_user_command(
|
|||
"MP",
|
||||
function (args)
|
||||
if args.fargs[1] == "login" then
|
||||
client.login(args.fargs[2], args.fargs[3], args.fargs[4])
|
||||
if #args.fargs < 2 then error("missing workspace name") end
|
||||
local user = vim.fn.input("username > ", "user-" .. vim.fn.rand() % 1024)
|
||||
local password = vim.fn.input("password > ", "lmaodefaultpassword")
|
||||
client.login(user, password, args.fargs[2])
|
||||
elseif args.fargs[1] == "create" then
|
||||
if #args.fargs < 2 then error("missing buffer name") end
|
||||
if client.workspace == nil then error("connect to a workspace first") end
|
||||
|
|
Loading…
Reference in a new issue