local a={...}local b=1;local c={}while b<=#a do local d=a[b]if d=="-l"then b=b+1;c.newname=a[b]elseif d=="-p"then b=b+1;c.password=a[b]elseif d=="-g"then b=b+1;c.gid=tonumber(a[b])elseif d=="-d"then b=b+1;c.homedir=a[b]elseif d=="-s"then b=b+1;c.shell=a[b]elseif d=="-L"then c.lock=true elseif d=="-U"then c.unlock=true elseif d:sub(1,1)~="-"then c.username=d else print("usermod: unknown option: "..d)syscall.exit(1)return end;b=b+1 end;if not c.username then print("Usage: usermod [-l newname] [-p password] [-g gid] [-d homedir] [-s shell] [-L] [-U] ")syscall.exit(1)return end;if c.lock and c.unlock then print("usermod: -L and -U are mutually exclusive")syscall.exit(1)return end;local e=syscall.getuid(c.username)if not e then print("usermod: user '"..c.username.."' does not exist")syscall.exit(1)return end;local function f(g,...)local h,i=g(...)if not h then print("usermod: "..tostring(i))syscall.exit(1)end end;if c.newname then f(syscall.setusername,e,c.newname)end;if c.password then f(syscall.setpassword,e,c.password)end;if c.gid then f(syscall.setgid,e,c.gid)end;if c.homedir then f(syscall.sethomedir,e,c.homedir)end;if c.shell then f(syscall.setshell,e,c.shell)end;if c.lock then f(syscall.lockuser,e)end;if c.unlock then f(syscall.unlockuser,e)end;print("usermod: updated user '"..c.username.."'")