Skip to content

Commit efe6b1d

Browse files
authored
Add winget pin custom completions (#1210)
Source: [winget pin docs](https://learn.microsoft.com/en-us/windows/package-manager/winget/pinning)
1 parent e65d76c commit efe6b1d

1 file changed

Lines changed: 109 additions & 0 deletions

File tree

custom-completions/winget/winget-completions.nu

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,115 @@ export def "winget list" [
342342
}
343343
export alias "winget ls" = winget list
344344

345+
# Add a pin. This subcommand requires that you specify the exact package to pin. If there is any ambiguity, you will be prompted to further filter the add subcommand to an exact application.
346+
export extern "winget pin add" [
347+
query?: string,
348+
--query(-q): string, # The query used to search for a package
349+
--id: string, # Limit search by ID
350+
--name: string, # Limit search by name
351+
--moniker: string, # Limit search by moniker listed
352+
--tag: string # Limit search by tag listed
353+
--cmd: string # Limit search by command
354+
--command: string # Limit search by command
355+
--exact(-e), # Uses exact query string
356+
--version(-v): string, # Pin exact version, wildcard * can be used as last part, changes pin behavior to gating
357+
--source(-s): string@"nu-complete winget install source", # Restrict search to source
358+
--header: string # Optional REST source HTTP header
359+
--authentication-mode: string # Specify authentication window preference (silent, silentPreferred or interactive)
360+
--authentication-account: string # Specify the account to be used for authentication
361+
--accept-source-agreements, # Accept all source agreements during source operations
362+
--force, # Override the installer hash check
363+
--blocking # Block from upgrading until the pin is removed, preventing override arguments. Changes pin behavior to be blocking.
364+
--installed: string # Pin a specific installed version
365+
--help(-?) # Display the help for this command
366+
--wait # Prompts the user to press any key before exiting
367+
--logs # Open the default logs location
368+
--open-logs # Open the default logs location
369+
--verbose # Override the logging setting and create a verbose log
370+
--verbose-logs # Override the logging setting and create a verbose log
371+
--nowarn # Suppress waring outputs
372+
--ignore-warnings # Suppress waring outputs
373+
--disable-interactivity # Disable interactive prompts
374+
--proxy: string # Use a proxy
375+
--no-proxy # Do not use a proxy
376+
]
377+
378+
# Remove a pin. This subcommand requires that you specify the exact package pin to remove. If there is any ambiguity, you will be prompted to further filter the remove subcommand to an exact application.
379+
export extern "winget pin remove" [
380+
query?: string,
381+
--query(-q): string, # The query used to search for a package
382+
--id: string, # Limit search by ID
383+
--name: string, # Limit search by name
384+
--moniker: string, # Limit search by moniker listed
385+
--source(-s): string@"nu-complete winget install source", # Restrict search to source
386+
--tag: string # Limit search by tag listed
387+
--cmd: string # Limit search by command
388+
--command: string # Limit search by command
389+
--exact(-e), # Uses exact query string
390+
--header: string # Optional REST source HTTP header
391+
--authentication-mode: string # Specify authentication window preference (silent, silentPreferred or interactive)
392+
--authentication-account: string # Specify the account to be used for authentication
393+
--accept-source-agreements, # Accept all source agreements during source operations
394+
--installed: string # Pin a specific installed version
395+
--help(-?) # Display the help for this command
396+
--wait # Prompts the user to press any key before exiting
397+
--logs # Open the default logs location
398+
--open-logs # Open the default logs location
399+
--verbose # Override the logging setting and create a verbose log
400+
--verbose-logs # Override the logging setting and create a verbose log
401+
--nowarn # Suppress waring outputs
402+
--ignore-warnings # Suppress waring outputs
403+
--disable-interactivity # Disable interactive prompts
404+
--proxy: string # Use a proxy
405+
--no-proxy # Do not use a proxy
406+
]
407+
408+
# List all current pins
409+
export extern "winget pin list" [
410+
query?: string,
411+
--query(-q): string, # The query used to search for a package
412+
--id: string, # Limit search by ID
413+
--name: string, # Limit search by name
414+
--moniker: string, # Limit search by moniker listed
415+
--source(-s): string@"nu-complete winget install source", # Restrict search to source
416+
--tag: string # Limit search by tag listed
417+
--cmd: string # Limit search by command
418+
--command: string # Limit search by command
419+
--exact(-e), # Uses exact query string
420+
--header: string # Optional REST source HTTP header
421+
--authentication-mode: string # Specify authentication window preference (silent, silentPreferred or interactive)
422+
--authentication-account: string # Specify the account to be used for authentication
423+
--accept-source-agreements, # Accept all source agreements during source operations
424+
--help(-?) # Display the help for this command
425+
--wait # Prompts the user to press any key before exiting
426+
--logs # Open the default logs location
427+
--open-logs # Open the default logs location
428+
--verbose # Override the logging setting and create a verbose log
429+
--verbose-logs # Override the logging setting and create a verbose log
430+
--nowarn # Suppress waring outputs
431+
--ignore-warnings # Suppress waring outputs
432+
--disable-interactivity # Disable interactive prompts
433+
--proxy: string # Use a proxy
434+
--no-proxy # Do not use a proxy
435+
]
436+
437+
# Reset all pins. Without --force, shows all that would be removed. With --force, removes them.
438+
export extern "winget pin reset" [
439+
--force # Direct run the command and continue with non security related issues
440+
--source(-s): string@"nu-complete winget install source", # Restrict search to source
441+
--help(-?) # Display the help for this command
442+
--wait # Prompts the user to press any key before exiting
443+
--logs # Open the default logs location
444+
--open-logs # Open the default logs location
445+
--verbose # Override the logging setting and create a verbose log
446+
--verbose-logs # Override the logging setting and create a verbose log
447+
--nowarn # Suppress waring outputs
448+
--ignore-warnings # Suppress waring outputs
449+
--disable-interactivity # Disable interactive prompts
450+
--proxy: string # Use a proxy
451+
--no-proxy # Do not use a proxy
452+
]
453+
345454
def "winget upgrades" [] {
346455
let output = ^winget upgrade | nu-complete winget trimLoadingSymbol
347456

0 commit comments

Comments
 (0)