mirror of
https://github.com/apple/container.git
synced 2026-08-28 19:36:31 +00:00
Cleans up registry subcommand options. (#660)
- Part of #515. - Order options alphabetically. ## Motivation and Context See #515.
This commit is contained in:
@@ -90,8 +90,8 @@ extension Application {
|
||||
for network in networks {
|
||||
group.addTask {
|
||||
do {
|
||||
// delete atomically disables the IP allocator, then deletes
|
||||
// the allocator disable fails if any IPs are still in use
|
||||
// Delete atomically disables the IP allocator, then deletes
|
||||
// the allocator. The disable fails if any IPs are still in use.
|
||||
try await ClientNetwork.delete(id: network.id)
|
||||
print(network.id)
|
||||
return nil
|
||||
|
||||
@@ -25,20 +25,23 @@ extension Application {
|
||||
public struct Login: AsyncParsableCommand {
|
||||
public init() {}
|
||||
public static let configuration = CommandConfiguration(
|
||||
abstract: "Login to a registry"
|
||||
abstract: "Log in to a registry"
|
||||
)
|
||||
|
||||
@Option(name: .shortAndLong, help: "Username")
|
||||
var username: String = ""
|
||||
@OptionGroup
|
||||
var registry: Flags.Registry
|
||||
|
||||
@Flag(help: "Take the password from stdin")
|
||||
var passwordStdin: Bool = false
|
||||
|
||||
@Argument(help: "Registry server name")
|
||||
var server: String
|
||||
@Option(name: .shortAndLong, help: "Registry user name")
|
||||
var username: String = ""
|
||||
|
||||
@OptionGroup
|
||||
var registry: Flags.Registry
|
||||
var global: Flags.Global
|
||||
|
||||
@Argument(help: "Registry server name")
|
||||
var server: String
|
||||
|
||||
public func run() async throws {
|
||||
var username = self.username
|
||||
|
||||
@@ -25,12 +25,12 @@ extension Application {
|
||||
public static let configuration = CommandConfiguration(
|
||||
abstract: "Log out from a registry")
|
||||
|
||||
@Argument(help: "Registry server name")
|
||||
var registry: String
|
||||
|
||||
@OptionGroup
|
||||
var global: Flags.Global
|
||||
|
||||
@Argument(help: "Registry server name")
|
||||
var registry: String
|
||||
|
||||
public func run() async throws {
|
||||
let keychain = KeychainHelper(id: Constants.keychainID)
|
||||
let r = Reference.resolveDomain(domain: registry)
|
||||
|
||||
@@ -18,15 +18,16 @@ import ArgumentParser
|
||||
|
||||
extension Application {
|
||||
public struct RegistryCommand: AsyncParsableCommand {
|
||||
public init() {}
|
||||
public static let configuration = CommandConfiguration(
|
||||
commandName: "registry",
|
||||
abstract: "Manage registry configurations",
|
||||
abstract: "Manage registry logins",
|
||||
subcommands: [
|
||||
Login.self,
|
||||
Logout.self,
|
||||
],
|
||||
aliases: ["r"]
|
||||
)
|
||||
|
||||
public init() {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ extension Application.VolumeCommand {
|
||||
for volume in volumes {
|
||||
group.addTask {
|
||||
do {
|
||||
// delete atomically disables the IP allocator, then deletes
|
||||
// the allocator disable fails if any IPs are still in use
|
||||
try await ClientVolume.delete(name: volume.id)
|
||||
print(volume.id)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user