Documentation
¶
Index ¶
- Variables
- func HasCmdOnelinerChilds(cmd *cobra.Command) bool
- func IsCmdAnnotatedOneliner(annot map[string]string) bool
- func NewRunner(tpl *template.Template, msg, tplPath string, fillers ...map[string]any) *template.Runner
- func NewRunnerRequiredParamsOnly(tpl *template.Template, msg, tplPath string, fillers ...map[string]any) *template.Runner
- func RootContext() context.Context
- func SetRootContext(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
var ErrExitZero = errors.New("awless: nothing further to report")
ErrExitZero reports that a command has already told the user everything they need and should end successfully without printing an error.
Exists so those paths can return through cobra like any other outcome instead of calling os.Exit(0) mid-call, which skipped deferred cleanup and bypassed the single exit point in main.
var ErrReported = errors.New("awless: command failed")
ErrReported marks a failure whose explanation has already been printed, usually through logger.Errorf together with a suggested command.
Returning it exits non-zero without printing a second message, which is what these paths used os.Exit(1) for. Keeping them as errors means deferred cleanup runs and there is still only one exit point.
var RootCmd = &cobra.Command{ SilenceErrors: true, Use: "awless COMMAND", Short: "Manage and explore your cloud", Long: `awless is a powerful CLI to explore, sync and manage your cloud infrastructure. Supported services: EC2, IAM, S3, RDS, ELBv2, Auto Scaling, Lambda, SNS, SQS, Route53, CloudWatch, CloudFront, ECR, ECS, ACM, CloudFormation, EKS, DynamoDB, Secrets Manager, KMS, API Gateway v2, SSM, EFS, CloudTrail, CloudWatch Logs. Quick examples: awless list instances --filter state=running awless list loggroups --format json awless show my-resource awless create instance type=t2.micro distro=debian awless ssh my-instance`, BashCompletionFunction: bashCompletionFunc, RunE: func(c *cobra.Command, args []string) error { if versionGlobalFlag { printVersion(c, args) return nil } return c.Usage() }, }
Functions ¶
func HasCmdOnelinerChilds ¶
func IsCmdAnnotatedOneliner ¶
func RootContext ¶
RootContext returns the process context, or context.Background() if it was never set — which happens in tests that exercise commands directly.
func SetRootContext ¶
SetRootContext installs the process context. Called once from main.
Types ¶
This section is empty.