Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix export command usage #1450

Merged
merged 2 commits into from
Jul 9, 2024
Merged

Conversation

myd7349
Copy link
Contributor

@myd7349 myd7349 commented Jul 6, 2024

It seems export command gives wrong help message for specifying output directory.

C:\Users\myd7349>vcpkg export edflib --directory D:\edflib
error: unexpected switch: --directory
vcpkg export <port names> [--nuget] [--directory=out_dir]
vcpkg export zlib zlib:x64-windows boost --nuget
Options:
    ...

@myd7349
Copy link
Contributor Author

myd7349 commented Jul 6, 2024

vcpkg export <port names> [--nuget] [--output-dir=out_dir]"

vs

vcpkg export <port names> [--nuget] [--output-dir=<dir>]"

Which one do you prefer?

Should I update other l10n files in locales folder or just leave to bot?

@dg0yt
Copy link
Contributor

dg0yt commented Jul 6, 2024

C:\Users\myd7349>vcpkg export edflib --directory D:\edflib
error: unexpected switch: --directory
vcpkg export [--nuget] [--directory=out_dir]

Does the = make a difference?

@myd7349
Copy link
Contributor Author

myd7349 commented Jul 6, 2024

C:\Users\myd7349>vcpkg export edflib --directory D:\edflib
error: unexpected switch: --directory
vcpkg export [--nuget] [--directory=out_dir]

Does the = make a difference?

Still with no luck:

C:\Users\myd7349>vcpkg export edflib --directory=D:\abc --zip
error: unexpected option: --directory=D:\abc
vcpkg export <port names> [--nuget] [--directory=out_dir]
vcpkg export zlib zlib:x64-windows boost --nuget

--output-dir, however, works in both cases:

C:\Users\myd7349>vcpkg export edflib --output-dir D:\abc --zip
The following packages are already built and will be exported:
    edflib:x64-windows
  * vcpkg-cmake:x64-windows
  * vcpkg-cmake-config:x64-windows
Additional packages (*) need to be exported to complete this operation.
Exporting vcpkg-cmake:x64-windows...
Exporting vcpkg-cmake-config:x64-windows...
Exporting edflib:x64-windows...
Creating zip archive...
Zip archive exported at: D:\abc\vcpkg-export-20240706-195740.zip
To use exported libraries in CMake projects, add -DCMAKE_TOOLCHAIN_FILE=[...]/scripts/buildsystems/vcpkg.cmake to your CMake command line.

C:\Users\myd7349>vcpkg export edflib --output-dir=D:\abc --zip
The following packages are already built and will be exported:
    edflib:x64-windows
  * vcpkg-cmake:x64-windows
  * vcpkg-cmake-config:x64-windows
Additional packages (*) need to be exported to complete this operation.
Exporting vcpkg-cmake:x64-windows...
Exporting vcpkg-cmake-config:x64-windows...
Exporting edflib:x64-windows...
Creating zip archive...
Zip archive exported at: D:\abc\vcpkg-export-20240706-195751.zip
To use exported libraries in CMake projects, add -DCMAKE_TOOLCHAIN_FILE=[...]/scripts/buildsystems/vcpkg.cmake to your CMake command line.

@myd7349
Copy link
Contributor Author

myd7349 commented Jul 6, 2024

auto output_dir_opt = Util::lookup_value(options.settings, SwitchOutputDir);

and

ret.output_dir = ret.output_dir.empty() ? Util::lookup_value(options.settings, SwitchOutputDir)

both references SwitchOutputDir, which is defined here:

inline constexpr StringLiteral SwitchOutputDir = "output-dir";

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@BillyONeal BillyONeal merged commit bbb0318 into microsoft:main Jul 9, 2024
5 checks passed
@myd7349 myd7349 deleted the fix-export-usage branch July 10, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants