Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/cmd/cloud_alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudAlertingCommand(cloudCmd *cobra.Command) {
Expand All @@ -16,6 +17,7 @@ func initCloudAlertingCommand(cloudCmd *cobra.Command) {
Short: "Manage billing alert configurations in the given cloud project",
}
alertingCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
alertingCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

// List alerting configurations
alertingListCmd := &cobra.Command{
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/flags"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func getInstanceCreationCmd() *cobra.Command {
Expand Down Expand Up @@ -146,6 +147,7 @@ func initInstanceCommand(cloudCmd *cobra.Command) {
Short: "Manage instances in the given cloud project",
}
instanceCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
instanceCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

instanceListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

// cloudIPType holds the value of the persistent --type flag for `cloud ip` commands.
Expand Down Expand Up @@ -38,6 +39,7 @@ func initCloudIPCommand(cloudCmd *cobra.Command) {
Short: "Manage public IPs (floating and failover) in the given cloud project",
}
ipCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
ipCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck
ipCmd.PersistentFlags().StringVar(&cloudIPType, "type", "", "Type of IP to manage (floating or failover)")

// region flag is only relevant for floating IPs (failover IPs are project-scoped)
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudLoadbalancerCommand(cloudCmd *cobra.Command) {
Expand All @@ -16,6 +17,7 @@ func initCloudLoadbalancerCommand(cloudCmd *cobra.Command) {
Short: "Manage loadbalancers in the given cloud project",
}
loadbalancerCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
loadbalancerCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

loadbalancerListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_managed_analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initManagedAnalyticsCommand(cloudCmd *cobra.Command) {
Expand All @@ -15,6 +16,7 @@ func initManagedAnalyticsCommand(cloudCmd *cobra.Command) {
Short: "Manage managed analytics services in the given cloud project",
}
managedAnalyticsCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
managedAnalyticsCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck
// Managed analytics commands
managedAnalyticsCmd.AddCommand(withFilterFlag(&cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_managed_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initManagedDatabaseCommand(cloudCmd *cobra.Command) {
Expand All @@ -15,6 +16,7 @@ func initManagedDatabaseCommand(cloudCmd *cobra.Command) {
Short: "Manage managed database services in the given cloud project",
}
managedDatabaseCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
managedDatabaseCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

// Managed database commands
managedDatabaseCmd.AddCommand(withFilterFlag(&cobra.Command{
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_managed_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/flags"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initKubeCommand(cloudCmd *cobra.Command) {
Expand All @@ -20,6 +21,7 @@ func initKubeCommand(cloudCmd *cobra.Command) {
Short: "Manage Kubernetes clusters in the given cloud project",
}
kubeCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
kubeCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

// Command to list Kuberetes clusters
kubeListCmd := &cobra.Command{
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_managed_rancher.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudRancherCommand(cloudCmd *cobra.Command) {
Expand All @@ -17,6 +18,7 @@ func initCloudRancherCommand(cloudCmd *cobra.Command) {
Short: "Manage Rancher services in the given cloud project",
}
rancherCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
rancherCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

rancherListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_managed_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initContainerRegistryCommand(cloudCmd *cobra.Command) {
Expand All @@ -17,6 +18,7 @@ func initContainerRegistryCommand(cloudCmd *cobra.Command) {
Short: "Manage container registries in the given cloud project",
}
registryCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
registryCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

listCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/flags"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudNetworkCommand(cloudCmd *cobra.Command) {
Expand All @@ -17,6 +18,7 @@ func initCloudNetworkCommand(cloudCmd *cobra.Command) {
Short: "Manage networks in the given cloud project",
}
networkCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
networkCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck
cloudCmd.AddCommand(networkCmd)

// Private network commands
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudOperationCommand(cloudCmd *cobra.Command) {
Expand All @@ -15,6 +16,7 @@ func initCloudOperationCommand(cloudCmd *cobra.Command) {
Short: "List and get operations in the given cloud project",
}
operationCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
operationCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

operationListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func init() {
Expand All @@ -20,6 +21,7 @@ func init() {
Short: "Retrieve information and manage your CloudProject services",
}
cloudprojectCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
cloudprojectCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

// Command to list CloudProject services
cloudprojectCmd.AddCommand(withFilterFlag(&cobra.Command{
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudQuotaCommand(cloudCmd *cobra.Command) {
Expand All @@ -15,6 +16,7 @@ func initCloudQuotaCommand(cloudCmd *cobra.Command) {
Short: "Check quotas in the given cloud project",
}
quotaCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
quotaCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

quotaCmd.AddCommand(&cobra.Command{
Use: "get <region>",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudReferenceCmd(cloudCmd *cobra.Command) {
Expand All @@ -16,6 +17,7 @@ func initCloudReferenceCmd(cloudCmd *cobra.Command) {
}

referenceCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
referenceCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

// Flavors
var region string
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudRegionCommand(cloudCmd *cobra.Command) {
Expand All @@ -15,6 +16,7 @@ func initCloudRegionCommand(cloudCmd *cobra.Command) {
Short: "Check regions in the given cloud project",
}
regionCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
regionCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

regionListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_savings_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudSavingsPlanCommand(cloudCmd *cobra.Command) {
Expand All @@ -26,6 +27,7 @@ Available flavors include:
- Memory optimized instances: r3-16, r3-32, r3-64, r3-128, r3-256, r3-512`,
}
savingsPlanCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
savingsPlanCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

// List subscribed savings plans
listCmd := &cobra.Command{
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudSSHKeyCommand(cloudCmd *cobra.Command) {
Expand All @@ -16,6 +17,7 @@ func initCloudSSHKeyCommand(cloudCmd *cobra.Command) {
Short: "Manage SSH keys in the given cloud project",
}
sshKeyCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
sshKeyCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

sshKeyListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_storage_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/flags"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudVolumeCommand(cloudCmd *cobra.Command) {
Expand All @@ -17,6 +18,7 @@ func initCloudVolumeCommand(cloudCmd *cobra.Command) {
Short: "Manage block storage volumes in the given cloud project",
}
storageBlockCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
storageBlockCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

volumeListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_storage_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudStorageFileCommand(cloudCmd *cobra.Command) {
Expand All @@ -16,6 +17,7 @@ func initCloudStorageFileCommand(cloudCmd *cobra.Command) {
Short: "Manage file storage shares in the given cloud project",
}
storageFileCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
storageFileCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck
storageFileCmd.PersistentFlags().StringVar(&cloud.ShareRegion, "region", "", "Region (skip region discovery if set)")

// Share commands
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_storage_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudStorageS3Command(cloudCmd *cobra.Command) {
Expand All @@ -17,6 +18,7 @@ func initCloudStorageS3Command(cloudCmd *cobra.Command) {
Short: "Manage S3™* compatible storage containers in the given cloud project (* S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.)",
}
storageS3Cmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
storageS3Cmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

storageS3ListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_storage_swift.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudStorageSwiftCommand(cloudCmd *cobra.Command) {
Expand All @@ -15,6 +16,7 @@ func initCloudStorageSwiftCommand(cloudCmd *cobra.Command) {
Short: "Manage SWIFT storage containers in the given cloud project",
}
storageSwiftCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
storageSwiftCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

storageSwiftListCmd := &cobra.Command{
Use: "list",
Expand Down
2 changes: 2 additions & 0 deletions internal/cmd/cloud_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ovh/ovhcloud-cli/internal/assets"
"github.com/ovh/ovhcloud-cli/internal/services/cloud"
"github.com/spf13/cobra"
"github.com/ovh/ovhcloud-cli/internal/completion"
)

func initCloudUserCommand(cloudCmd *cobra.Command) {
Expand All @@ -16,6 +17,7 @@ func initCloudUserCommand(cloudCmd *cobra.Command) {
Short: "Manage users in the given cloud project",
}
userCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID")
userCmd.RegisterFlagCompletionFunc("cloud-project", completion.CloudProjects) //nolint:errcheck

userListCmd := &cobra.Command{
Use: "list",
Expand Down
Loading
Loading