]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | # vcpkg completions for fish |
2 | set vcpkg_executable (string split -m1 ' ' (commandline -cb))[1] | |
3 | ||
4 | function _vcpkg_completions | |
5 | set arg (string split -m1 ' ' (commandline -cb))[2] | |
6 | set curr_token (commandline -t) | |
7 | if [ -n $arg ] | |
8 | if [ -z $curr_token ] | |
9 | set arg $arg " " | |
10 | end | |
11 | end | |
12 | for key in ($vcpkg_executable autocomplete "$arg" -- 2>/dev/null) | |
13 | echo $key | |
14 | end | |
15 | end | |
16 | ||
17 | complete -c vcpkg -f --arguments '(_vcpkg_completions)' | |
18 | ||
19 | set vcpkg_commands ($vcpkg_executable autocomplete) | |
20 | ||
21 | function _set_triplet_arguments | |
22 | set triplets ($vcpkg_executable help triplet) | |
23 | set -e triplets[(contains -i -- "Available architecture triplets" $triplets)] | |
24 | set -e triplets[(contains -i -- "" $triplets)] | |
25 | set triplet_from "" | |
26 | for triplet in $triplets | |
27 | echo (test -n "$triplet") >> temp.txt | |
28 | if [ (string sub -l5 -- $triplet) = "VCPKG" ] | |
29 | set -l temp (string length $triplet) | |
30 | set triplet_from (string sub -s6 -l(math $temp - 15) -- $triplet) | |
31 | else if [ -n "$triplet" ] | |
32 | complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l triplet -d "$triplet_from" -a (string sub -s3 -- $triplet) | |
33 | end | |
34 | end | |
35 | end | |
36 | _set_triplet_arguments | |
37 | ||
38 | # options for all completions | |
39 | complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l triplet -d "Specify the target architecture triplet. See 'vcpkg help triplet' (default: \$VCPKG_DEFAULT_TRIPLET)" | |
40 | complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l overlay-ports -d "Specify directories to be used when searching for ports (also: \$VCPKG_OVERLAY_PORTS)" -a '(__fish_complete_directories)' | |
41 | complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l overlay-triplets -d "Specify directories containing triplets files (also: \$VCPKG_OVERLAY_TRIPLETS)" -a '(__fish_complete_directories)' | |
42 | complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l binarysource -d "Add sources for binary caching. See 'vcpkg help binarycaching'" -a '(__fish_complete_directories)' | |
43 | complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l downloads-root -d "Specify the downloads root directory (default: \$VCPKG_DOWNLOADS)" -a '(__fish_complete_directories)' | |
44 | complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l vcpkg-root -d "Specify the vcpkg root directory (default: \$VCPKG_ROOT)" -a '(__fish_complete_directories)' | |
45 | ||
46 | # options for install | |
47 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l dry-run -d "Do not actually build or install" | |
48 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l head -d "Install the libraries on the command line using the latest upstream sources" | |
49 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l no-downloads -d "Do not download new sources" | |
50 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l only-downloads -d "Download sources but don't build packages" | |
51 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l recurse -d "Allow removal of packages as part of installation" | |
52 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l keep-going -d "Continue installing packages on failure" | |
53 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l editable -d "Disable source re-extraction and binary caching for libraries on the command line" | |
54 | complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l clean-after-build -d "Clean buildtrees, packages and downloads after building each package" | |
55 | ||
56 | # options for edit | |
57 | complete -c vcpkg -n "__fish_seen_subcommand_from edit" -f -l buildtrees -d "Open editor into the port-specific buildtree subfolder" | |
58 | complete -c vcpkg -n "__fish_seen_subcommand_from edit" -f -l all -d "Open editor into the port as well as the port-specific buildtree subfolder" | |
59 | ||
60 | # options for export | |
61 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l dry-run -d "Do not actually export" | |
62 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l raw -d "Export to an uncompressed directory" | |
63 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l nuget -d "Export a NuGet package" | |
64 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l ifw -d "Export to an IFW-based installer" | |
65 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l zip -d "Export to a zip file" | |
66 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l 7zip -d "Export to a 7zip (.7z) file" | |
67 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l prefab -d "Export to Prefab format" | |
68 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l prefab-maven -d "Enable maven" | |
69 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l prefab-debug -d "Enable prefab debug" | |
70 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l output -d "Specify the output name (used to construct filename)" | |
71 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l output-dir -d "Specify the output directory for produced artifacts" -a '(__fish_complete_directories)' | |
72 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l nuget-id -d "Specify the id for the exported NuGet package (overrides --output)" | |
73 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l nuget-version -d "Specify the version for the exported NuGet package" | |
74 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-repository-url -d "Specify the remote repository URL for the online installer" | |
75 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-packages-directory-path -d "Specify the temporary directory path for the repacked packages" | |
76 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-repository-directory-path -d "Specify the directory path for the exported repository" | |
77 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-configuration-file-path -d "Specify the temporary file path for the installer configuration" | |
78 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-installer-file-path -d "Specify the file path for the exported installer" | |
79 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-group-id -d "GroupId uniquely identifies your project according maven specifications" | |
80 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-artifact-id -d "Artifact Id is the name of the project according maven specifications" | |
81 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-version -d "Version is the name of the project according maven specifications" | |
82 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-min-sdk -d "Android minimum supported sdk version" | |
83 | complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-target-sdk -d "Android target sdk version" | |
84 | ||
85 | # options for remove | |
86 | complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l purge -d "Remove the cached copy of the package (default)" | |
87 | complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l no-purge -d "Do not remove the cached copy of the package (deprecated)" | |
88 | complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l recurse -d "Allow removal of packages not explicitly specified on the command line" | |
89 | complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l dry-run -d "Print the packages to be removed, but do not remove them" | |
90 | complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l outdated -d "Select all packages with versions that do not match the portfiles" | |
91 | ||
92 | # options for upgrade | |
93 | complete -c vcpkg -n "__fish_seen_subcommand_from upgrade" -f -l no-dry-run -d "Actually upgrade" | |
94 | complete -c vcpkg -n "__fish_seen_subcommand_from upgrade" -f -l keep-going -d "Continue installing packages on failure" |