Skip to content

Instantly share code, notes, and snippets.

@binyaminyblatt
Last active March 18, 2021 08:22
Show Gist options
  • Save binyaminyblatt/9df5a0adcbb31307c9d735ae462b694c to your computer and use it in GitHub Desktop.
Save binyaminyblatt/9df5a0adcbb31307c9d735ae462b694c to your computer and use it in GitHub Desktop.
local source_parser = clink.argmatcher():addarg({
"add",
"list",
"update",
"remove",
"reset"
}):addflags({
"--name",
"--arg",
"--type"
})
local hash_flags = clink.argmatcher():addarg({
"--file",
"--msix"
})
local validate_flags = clink.argmatcher():addarg({
"--manifest"
})
local install_flags = clink.argmatcher():addarg({
"--manifest",
"--id",
"--name",
"--moniker",
"--version",
"--source",
"--exact",
"--interactive",
"--silent",
"--log",
"--location",
"--query"
})
local search_flags = clink.argmatcher():addarg({
"--id",
"--name",
"--moniker",
"--tag",
"--command",
"--query"
})
local show_flags = clink.argmatcher():addarg({
"--manifest",
"--id",
"--name",
"--moniker",
"--version",
"--source",
"--exact",
"--versions"
})
local upgrade_flags = clink.argmatcher():addarg({
"--query",
"--manifest",
"--id",
"--name",
"--moniker",
"--version",
"--source",
"--exact",
"--interactive",
"--silent",
"--log",
"--override",
"--location",
"--force",
"--all"
})
local list_flags = clink.argmatcher():addarg({
"--query",
"--id",
"--name",
"--moniker",
"--source",
"--tag",
"--command",
"--count",
"--exact"
})
local uninstall_flags = clink.argmatcher():addarg({
"--query",
"--id",
"--name",
"--moniker",
"--version",
"--source",
"--exact",
"--interactive",
"--silent",
"--log"
})
local winget_parser ={
"install" .. install_flags,
"show" .. show_flags,
"source" .. source_parser,
"search" .. search_flags,
"list" .. list_flags,
"upgrade" .. upgrade_flags,
"uninstall" .. uninstall_flags,
"hash" .. hash_flags,
"validate" .. validate_flags,
"settings",
"features",
"experimental"
}
clink.argmatcher("winget", "winget.exe"):addarg(winget_parser):addflags("--version", "--info", "--help")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment