// Show starts the builder container and invokes the usage script on it
// to print usage information for the script.
358858
func (u *Usage) Show() error {
	b := u.handler
	defer u.garbage.Cleanup(u.config)

	b.SetScripts([]string{constants.Usage}, []string{})

	if err := b.Prepare(u.config); err != nil {
		return err
	}

	return b.Execute(constants.Usage, "", u.config)
}
331537
func (rc *ResourceController) ShowHandler(c *gin.Context) {
	c.Set("Action", "read")
	_, err := rc.LoadResource(c)
	if err != nil && err != ErrNotFound {
		c.AbortWithError(http.StatusInternalServerError, err)
		return
	}

	if err == ErrNotFound {
		c.Status(http.StatusNotFound)
		return
	}
	resource, _ := c.Get(rc.Name)
	c.JSON(http.StatusOK, resource)
}
1265694
func (s *Action) show(ctx context.Context, c *cli.Context, name, key string, recurse bool) error {
	if name == "" {
		return ExitError(ctx, ExitUsage, nil, "Usage: %s show [name]", s.Name)
	}

	if s.Store.IsDir(ctx, name) && !s.Store.Exists(ctx, name) {
		return s.List(ctx, c)
	}
	if s.Store.IsDir(ctx, name) && ctxutil.IsTerminal(ctx) {
		out.Cyan(ctx, "Warning: %s is a secret and a folder. Use 'gopass show %s' to display the secret and 'gopass list %s' to show the content of the folder", name, name, name)
	}

	// auto-fallback to binary files with b64 suffix, if unique
	if !s.Store.Exists(ctx, name) && s.Store.Exists(ctx, name+BinarySuffix) {
		name += BinarySuffix
	}

	if HasRevision(ctx) {
		return s.showHandleRevision(ctx, c, name, key, GetRevision(ctx))
	}

	sec, ctx, err := s.Store.GetContext(ctx, name)
	if err != nil {
		return s.showHandleError(ctx, c, name, recurse, err)
	}

	return s.showHandleOutput(ctx, name, key, sec)
}
684290
func Display(possible ...Cmd) {
	hint := randHint(possible)
	if hint != "" {
		ui.Hint(hint, false, nil)
	}
}
706978
func (engine *Engine) ShowSQL(show ...bool) {
	engine.logger.ShowSQL(show...)
	if len(show) == 0 {
		engine.showSQL = true
	} else {
		engine.showSQL = show[0]
	}
}
1133507
func (c *StatusController) Show(ctx *app.ShowStatusContext) error {
	res := &app.Status{
		Commit:    Commit,
		BuildTime: BuildTime,
		StartTime: StartTime,
	}

	devMode := c.config.IsPostgresDeveloperModeEnabled()
	if devMode {
		res.DevMode = &devMode
	}

	dbErr := c.dbChecker.Ping()
	if dbErr != nil {
		log.Error(ctx, map[string]interface{}{
			"db_error": dbErr.Error(),
		}, "database configuration error")
		res.DatabaseStatus = fmt.Sprintf("Error: %s", dbErr.Error())
	} else {
		res.DatabaseStatus = "OK"
	}

	configErr := c.config.DefaultConfigurationError()
	if configErr != nil {
		log.Error(ctx, map[string]interface{}{
			"config_error": configErr.Error(),
		}, "configuration error")
		res.ConfigurationStatus = fmt.Sprintf("Error: %s", configErr.Error())
	} else {
		res.ConfigurationStatus = "OK"
	}

	if dbErr != nil || (configErr != nil && !devMode) {
		return ctx.ServiceUnavailable(res)
	}
	return ctx.OK(res)
}
958281
func (icon *Icon) Show(prefix string) {
	icon.fshow(os.Stdout, prefix)
}
408189
func (v *View) Show() {
	if v.ShowState == nil {
		v.ShowState = &ShowView{}
	}
	v.activeState = v.ShowState
}
1221338
func ShowCompletions(c *Context) {
	a := c.App
	if a != nil && a.BashComplete != nil {
		a.BashComplete(c)
	}
}
58762
func (c *UserController) Show(ctx *app.ShowUserContext) error {
	// retrieve the user's identity ID from the token
	identityID, err := c.tokenManager.Locate(ctx)
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err,
		}, "Bad Token")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("bad or missing token"))
	}
	user, identity, err := c.app.UserService().UserInfo(ctx, identityID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	if user.Banned {
		ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
		ctx.ResponseData.Header().Set("WWW-Authenticate", "DEPROVISIONED description=\"Account has been banned\"")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("Account has been banned"))
	}

	return ctx.ConditionalRequest(*user, c.config.GetCacheControlUser, func() error {
		// Init tenant (if access to tenant service is configured/enabled)
		if c.tenantService != nil {
			go func(ctx context.Context) {
				c.tenantService.Init(ctx)
			}(ctx)
		}
		return ctx.OK(ConvertToAppUser(ctx.RequestData, user, identity, true))
	})
}
640319
func (p Show) Init(ctx sessionctx.Context) *Show {
	p.basePlan = newBasePlan(ctx, TypeShow)
	return &p
}
400634
func (b *AccountController) Show(c *app.ShowAccountContext) error {
	account, ok := b.db.GetAccount(c.AccountID)
	if !ok {
		return c.NotFound()
	}
	return c.OK(ToAccountMedia(&account))
}
1146329
func ShowHelp(err io.Writer) func(*cobra.Command, []string) error {
	return func(cmd *cobra.Command, args []string) error {
		cmd.SetOutput(err)
		cmd.HelpFunc()(cmd, args)
		return nil
	}
}
174263
func (n Notification) Show() (id uint32, err error) {
	conn, err := dbus.SessionBus()
	if err != nil {
		return
	}

	// We need to convert the interface type of the map to dbus.Variant as
	// people dont want to have to import the dbus package just to make use
	// of the notification hints.
	hints := map[string]dbus.Variant{}
	for k, v := range n.Hints {
		hints[k] = dbus.MakeVariant(v)
	}

	obj := conn.Object(DbusInterfacePath, DbusObjectPath)
	call := obj.Call(
		CallNotify,
		0,
		n.AppName,
		n.ReplacesID,
		n.AppIcon,
		n.Summary,
		n.Body,
		n.Actions,
		hints,
		n.Timeout)
	if err = call.Err; err != nil {
		return
	}

	err = call.Store(&id)
	return
}
796025
func (c *UserController) Show(ctx *app.ShowUserContext) error {
	client, err := newAuthClient(ctx, c.config, c.httpOptions...)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	res, err := client.ShowUser(goasupport.ForwardContextRequestID(ctx), authservice.ShowUserPath(), ctx.IfModifiedSince, ctx.IfNoneMatch)
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err.Error(),
		}, "unable to get user from the auth service")
		return jsonapi.JSONErrorResponse(ctx, errs.Wrap(err, "unable to get user from the auth service"))
	}
	defer rest.CloseResponse(res)

	switch res.StatusCode {
	case 200:
	// OK
	case 401:
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError(rest.ReadBody(res.Body)))
	default:
		return jsonapi.JSONErrorResponse(ctx, errors.NewInternalError(ctx, errs.Errorf("status: %s, body: %s", res.Status, rest.ReadBody(res.Body))))
	}

	authUser, _ := client.DecodeUser(res)

	if c.InitTenant != nil {
		go func(ctx context.Context) {
			c.InitTenant(ctx)
		}(ctx)
	}
	return ctx.OK(convertToAppUser(authUser))
}
323228
func (wr *Wrangler) ShowResharding(ctx context.Context, keyspace, shard string) (err error) {
	ki, err := wr.ts.GetKeyspace(ctx, keyspace)
	if err != nil {
		return err
	}
	if len(ki.ServedFroms) == 0 {
		return wr.showHorizontalResharding(ctx, keyspace, shard)
	}
	return wr.showVerticalResharding(ctx, keyspace, shard)
}
216577
func (c *WorkItemTypeGroupController) Show(ctx *app.ShowWorkItemTypeGroupContext) error {
	var typeGroup *workitem.WorkItemTypeGroup
	var err error
	err = application.Transactional(c.db, func(appl application.Application) error {
		typeGroup, err = appl.WorkItemTypeGroups().Load(ctx, ctx.GroupID)
		if err != nil {
			return errs.WithStack(err)
		}
		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.OK(&app.WorkItemTypeGroupSingle{
		Data: ConvertTypeGroup(ctx.Request, *typeGroup),
	})
}