feat: support alias translation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
See #627
This commit is contained in:
@ -3,6 +3,7 @@ package app
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
@ -15,10 +16,14 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// translators: `abra app volume list` aliases. use a comma separated list of aliases with
|
||||
// no spaces in between
|
||||
var appVolumeListAliases = i18n.G("ls")
|
||||
|
||||
var AppVolumeListCommand = &cobra.Command{
|
||||
// translators: `app volume list` command
|
||||
Use: i18n.G("list <domain> [flags]"),
|
||||
Aliases: []string{i18n.G("ls")},
|
||||
Aliases: strings.Split(appVolumeListAliases, ","),
|
||||
// translators: Short description for `app list` command
|
||||
Short: i18n.G("List volumes associated with an app"),
|
||||
Args: cobra.ExactArgs(1),
|
||||
@ -74,6 +79,10 @@ var AppVolumeListCommand = &cobra.Command{
|
||||
},
|
||||
}
|
||||
|
||||
// translators: `abra app volume remove` aliases. use a comma separated list of aliases with
|
||||
// no spaces in between
|
||||
var appVolumeRemoveAliases = i18n.G("rm")
|
||||
|
||||
var AppVolumeRemoveCommand = &cobra.Command{
|
||||
// translators: `app volume remove` command
|
||||
Use: i18n.G("remove <domain> [volume] [flags]"),
|
||||
@ -94,7 +103,7 @@ Passing "--force/-f" will select all volumes for removal. Be careful.`),
|
||||
|
||||
# delete specific volume
|
||||
abra app volume rm 1312.net my_volume`),
|
||||
Aliases: []string{i18n.G("rm")},
|
||||
Aliases: strings.Split(appVolumeRemoveAliases, ","),
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
ValidArgsFunction: func(
|
||||
cmd *cobra.Command,
|
||||
@ -190,10 +199,14 @@ Passing "--force/-f" will select all volumes for removal. Be careful.`),
|
||||
},
|
||||
}
|
||||
|
||||
// translators: `abra app volume` aliases. use a comma separated list of aliases with
|
||||
// no spaces in between
|
||||
var appVolumeAliases = i18n.G("vl")
|
||||
|
||||
var AppVolumeCommand = &cobra.Command{
|
||||
// translators: `app volume` command group
|
||||
Use: i18n.G("volume [cmd] [args] [flags]"),
|
||||
Aliases: []string{i18n.G("vl")},
|
||||
Aliases: strings.Split(appVolumeAliases, ","),
|
||||
Short: i18n.G("Manage app volumes"),
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user