🔥 describe 하위 명령어
1609자
23분
describe
하위 명령어는 가져온 컬렉션에 포함된 컬렉션이나 패키지의 메타데이터를 보여줍니다. 결과는 다른 도구와 통합할 수 있도록 --json
옵션을 사용해 JSON 형식으로 반환할 수 있죠.
가져온 컬렉션에는 여러 패키지가 포함될 수 있는데요, describe
하위 명령을 사용하면 각 패키지의 이름, 버전, 라이선스 등 패키지에 대한 중요한 정보를 쉽게 확인할 수 있습니다. 예를 들어, 다음과 같이 입력하면:
$ swift package-collection describe MyCollection
shell
그러면 MyCollection
이라는 컬렉션에 포함된 모든 패키지의 메타데이터가 표시됩니다. 출력 결과는 다음과 같은 형식으로 나타납니다:
Name: MyPackage Version: 1.0.0 License: Apache License 2.0 Description: A useful Swift package
text
만약 특정 패키지의 메타데이터만 보고 싶다면, 패키지 이름을 추가로 지정하면 됩니다:
$ swift package-collection describe MyCollection MyPackage
shell
이렇게 하면 MyCollection
컬렉션에 포함된 MyPackage
라는 이름의 패키지 메타데이터만 출력됩니다.
describe
하위 명령의 출력 결과를 다른 도구나 스크립트에서 활용하고 싶다면 --json
옵션을 사용하세요. 이 옵션을 추가하면 메타데이터가 JSON 형식으로 반환되므로, 파싱하기 쉽답니다.
$ swift package-collection describe MyCollection --json
shell
위 명령을 실행하면 다음과 같은 JSON 출력 결과를 얻을 수 있습니다:
[ { "name": "MyPackage", "version": "1.0.0", "license": "Apache License 2.0", "description": "A useful Swift package" }, { "name": "AnotherPackage", "version": "2.1.0", "license": "MIT License", "description": "Another handy Swift package" } ]
json
이런 식으로 describe
하위 명령을 활용하면, 가져온 Swift 패키지 컬렉션에 대한 유용한 정보를 쉽게 확인하고 다른 도구와 연동할 수 있습니다. 실제로 확인할 수 있는 예제는 다음과 같습니다:
$ swift package-collection add <https://swiftpackageindex.com/vapor/collection.json> ... $ swift package-collection describe <https://github.com/vapor/vapor> Description: 💧 A server-side Swift HTTP web framework. Available Versions: 4.92.5 Readme: <https://raw.githubusercontent.com/vapor/vapor/main/README.md> License: MIT (<https://raw.githubusercontent.com/vapor/vapor/main/LICENSE>) Authors: tanner0101, loganwright, Joannis, 0xTim, shnhrrsn, gwynne, ketzusaka, czechboy0, VaporBot, vzsg, siemensikkema, NathanFlurry, MaximBazarov, MrLotU, BennyDeBock, artkay, chinsyo, technikyle, adriencanterot, calebkleveter, skreutzberger, BrettRToomey, sarbogast, rafaelGuerreiro, rafiki270, MahdiBM, gtranchedone, kgn, Casperhr, twof Stars: 23706 Languages: Swift, HTML, C ------------------------------------------------------------ Latest Version: 4.92.5 Tools Version: 5.9.0 Package Name: vapor Modules: CVaporBcrypt, Vapor, Development, XCTVapor, VaporTests Products: Vapor, XCTVapor Verified Compatibility (Platform, Swift Version): (ios, 5.10), (ios, 5.7), (ios, 5.8), (ios, 5.9), (linux, 5.10), (linux, 5.7), (linux, 5.8), (linux, 5.9), (macos, 5.10), (macos, 5.7), (macos, 5.8), (macos, 5.9), (tvos, 5.10), (tvos, 5.7), (tvos, 5.8), (tvos, 5.9), (visionos, 5.10), (visionos, 5.9), (watchos, 5.10) License: MIT
text
json 포맷으로 출력해 볼게요:
swift package-collection describe <https://github.com/vapor/vapor> --json
text
{ "authors" : [ { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/tanner0101>", "username" : "tanner0101" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/loganwright>", "username" : "loganwright" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/Joannis>", "username" : "Joannis" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/0xTim>", "username" : "0xTim" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/shnhrrsn>", "username" : "shnhrrsn" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/gwynne>", "username" : "gwynne" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/ketzusaka>", "username" : "ketzusaka" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/czechboy0>", "username" : "czechboy0" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/VaporBot>", "username" : "VaporBot" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/vzsg>", "username" : "vzsg" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/siemensikkema>", "username" : "siemensikkema" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/NathanFlurry>", "username" : "NathanFlurry" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/MaximBazarov>", "username" : "MaximBazarov" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/MrLotU>", "username" : "MrLotU" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/BennyDeBock>", "username" : "BennyDeBock" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/artkay>", "username" : "artkay" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/chinsyo>", "username" : "chinsyo" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/technikyle>", "username" : "technikyle" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/adriencanterot>", "username" : "adriencanterot" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/calebkleveter>", "username" : "calebkleveter" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/skreutzberger>", "username" : "skreutzberger" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/BrettRToomey>", "username" : "BrettRToomey" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/sarbogast>", "username" : "sarbogast" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/rafaelGuerreiro>", "username" : "rafaelGuerreiro" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/rafiki270>", "username" : "rafiki270" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/MahdiBM>", "username" : "MahdiBM" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/gtranchedone>", "username" : "gtranchedone" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/kgn>", "username" : "kgn" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/Casperhr>", "username" : "Casperhr" }, { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/twof>", "username" : "twof" } ], "identity" : "vapor", "keywords" : [ "framework", "http", "http2", "server", "server-side-swift", "swift", "vapor", "web-framework" ], "languages" : [ "C", "HTML", "Swift" ], "license" : { "type" : { "_case" : "MIT" }, "url" : "<https://raw.githubusercontent.com/vapor/vapor/main/LICENSE>" }, "location" : "<https://github.com/vapor/vapor.git>", "readmeURL" : "<https://raw.githubusercontent.com/vapor/vapor/main/README.md>", "summary" : "💧 A server-side Swift HTTP web framework.", "versions" : [ { "author" : { "service" : { "name" : "GitHub" }, "url" : "<https://api.github.com/users/penny-for-vapor%5Bbot%5D>", "username" : "penny-for-vapor[bot]" }, "createdAt" : "2024-03-20T13:18:57Z", "defaultToolsVersion" : { "_version" : "5.9.0" }, "license" : { "type" : { "_case" : "MIT" }, "url" : "<https://github.com/vapor/vapor/blob/main/LICENSE>" }, "manifests" : [ { "_version" : "5.9.0" }, { "minimumPlatformVersions" : [ { "options" : [ ], "platform" : { "name" : "macos", "oldestSupportedVersion" : { "version" : "10.13.0" } }, "version" : { "version" : "10.15.0" } }, { "options" : [ ], "platform" : { "name" : "ios", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "version" : { "version" : "13.0.0" } }, { "options" : [ ], "platform" : { "name" : "tvos", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "version" : { "version" : "13.0.0" } }, { "options" : [ ], "platform" : { "name" : "watchos", "oldestSupportedVersion" : { "version" : "4.0.0" } }, "version" : { "version" : "6.0.0" } } ], "packageName" : "vapor", "products" : [ { "name" : "Vapor", "targets" : [ { "moduleName" : "Vapor", "name" : "Vapor" } ], "type" : { "library" : [ "automatic" ] } }, { "name" : "XCTVapor", "targets" : [ { "moduleName" : "XCTVapor", "name" : "XCTVapor" } ], "type" : { "library" : [ "automatic" ] } } ], "targets" : [ { "moduleName" : "CVaporBcrypt", "name" : "CVaporBcrypt" }, { "moduleName" : "Vapor", "name" : "Vapor" }, { "moduleName" : "Development", "name" : "Development" }, { "moduleName" : "XCTVapor", "name" : "XCTVapor" }, { "moduleName" : "VaporTests", "name" : "VaporTests" } ], "toolsVersion" : { "_version" : "5.9.0" } } ], "signer" : { "commonName" : "Swift Package Index", "organizationalUnitName" : "Swift Package Index", "organizationName" : "Swift Package Index", "type" : "adp" }, "summary" : "## What's Changed\nFix some Sendable warnings on 5.10 by @sidepelican in #3158\n\n> Fix a number of warnings in Swift 5.10 like below.\n> \n> Fix simple issues that can be addressed by simply adding `Sendable`.\n\n## New Contributor\n- @sidepelican made their first contribution in #3158 🎉\n\n\n###### _This patch was released by @0xTim_\n\n**Full Changelog**: <https://github.com/vapor/vapor/compare/4.92.4...4.92.5>", "title" : "4.92.5 - Fix some Sendable warnings on 5.10", "verifiedCompatibility" : [ { "platform" : { "name" : "ios", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.10" }, { "platform" : { "name" : "ios", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.7" }, { "platform" : { "name" : "ios", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.8" }, { "platform" : { "name" : "ios", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.9" }, { "platform" : { "name" : "linux", "oldestSupportedVersion" : { "version" : "0.0.0" } }, "swiftVersion" : "5.10" }, { "platform" : { "name" : "linux", "oldestSupportedVersion" : { "version" : "0.0.0" } }, "swiftVersion" : "5.7" }, { "platform" : { "name" : "linux", "oldestSupportedVersion" : { "version" : "0.0.0" } }, "swiftVersion" : "5.8" }, { "platform" : { "name" : "linux", "oldestSupportedVersion" : { "version" : "0.0.0" } }, "swiftVersion" : "5.9" }, { "platform" : { "name" : "macos", "oldestSupportedVersion" : { "version" : "10.13.0" } }, "swiftVersion" : "5.10" }, { "platform" : { "name" : "macos", "oldestSupportedVersion" : { "version" : "10.13.0" } }, "swiftVersion" : "5.7" }, { "platform" : { "name" : "macos", "oldestSupportedVersion" : { "version" : "10.13.0" } }, "swiftVersion" : "5.8" }, { "platform" : { "name" : "macos", "oldestSupportedVersion" : { "version" : "10.13.0" } }, "swiftVersion" : "5.9" }, { "platform" : { "name" : "tvos", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.10" }, { "platform" : { "name" : "tvos", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.7" }, { "platform" : { "name" : "tvos", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.8" }, { "platform" : { "name" : "tvos", "oldestSupportedVersion" : { "version" : "12.0.0" } }, "swiftVersion" : "5.9" }, { "platform" : { "name" : "visionos", "oldestSupportedVersion" : { "version" : "1.0.0" } }, "swiftVersion" : "5.10" }, { "platform" : { "name" : "visionos", "oldestSupportedVersion" : { "version" : "1.0.0" } }, "swiftVersion" : "5.9" }, { "platform" : { "name" : "watchos", "oldestSupportedVersion" : { "version" : "4.0.0" } }, "swiftVersion" : "5.10" } ], "version" : "4.92.5" } ], "watchersCount" : 23706 }
json