413 lines
11 KiB
Go
413 lines
11 KiB
Go
package executor
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"codeflow.dananglin.me.uk/apollo/enbas/internal/config"
|
|
"codeflow.dananglin.me.uk/apollo/enbas/internal/printer"
|
|
)
|
|
|
|
/*
|
|
This file is generated by ./cmd/enbas-cli-generators
|
|
DO NOT EDIT.
|
|
*/
|
|
|
|
// AcceptExecutor is the executor for the accept command.
|
|
type AcceptExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
resourceType string
|
|
}
|
|
|
|
func NewAcceptExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *AcceptExecutor {
|
|
exe := AcceptExecutor{
|
|
FlagSet: flag.NewFlagSet("accept", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("accept", "Accepts a request (e.g. a follow request)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// BlockExecutor is the executor for the block command.
|
|
type BlockExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
resourceType string
|
|
}
|
|
|
|
func NewBlockExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *BlockExecutor {
|
|
exe := BlockExecutor{
|
|
FlagSet: flag.NewFlagSet("block", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("block", "Blocks a resource (e.g. an account)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// DeleteExecutor is the executor for the delete command.
|
|
type DeleteExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
listID string
|
|
resourceType string
|
|
}
|
|
|
|
func NewDeleteExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *DeleteExecutor {
|
|
exe := DeleteExecutor{
|
|
FlagSet: flag.NewFlagSet("delete", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("delete", "Delete a specific resource", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.listID, "list-id", "", "The ID of the list in question")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// EditExecutor is the executor for the edit command.
|
|
type EditExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
listID string
|
|
listTitle string
|
|
listRepliesPolicy string
|
|
resourceType string
|
|
}
|
|
|
|
func NewEditExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *EditExecutor {
|
|
exe := EditExecutor{
|
|
FlagSet: flag.NewFlagSet("edit", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("edit", "Edit a specific resource", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.listID, "list-id", "", "The ID of the list in question")
|
|
exe.StringVar(&exe.listTitle, "list-title", "", "The title of the list")
|
|
exe.StringVar(&exe.listRepliesPolicy, "list-replies-policy", "", "The replies policy of the list")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// FollowExecutor is the executor for the follow command.
|
|
type FollowExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
notify bool
|
|
showReposts bool
|
|
resourceType string
|
|
}
|
|
|
|
func NewFollowExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *FollowExecutor {
|
|
exe := FollowExecutor{
|
|
FlagSet: flag.NewFlagSet("follow", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("follow", "Follow a resource (e.g. an account)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.BoolVar(&exe.notify, "notify", false, "Get notifications from statuses from the account you want to follow")
|
|
exe.BoolVar(&exe.showReposts, "show-reposts", true, "Show reposts from the account you want to follow")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// InitExecutor is the executor for the init command.
|
|
type InitExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
configDir string
|
|
}
|
|
|
|
func NewInitExecutor(
|
|
printer *printer.Printer,
|
|
configDir string,
|
|
) *InitExecutor {
|
|
exe := InitExecutor{
|
|
FlagSet: flag.NewFlagSet("init", flag.ExitOnError),
|
|
printer: printer,
|
|
configDir: configDir,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("init", "Creates a new configuration file in the specified configuration directory", exe.FlagSet)
|
|
|
|
return &exe
|
|
}
|
|
|
|
// LoginExecutor is the executor for the login command.
|
|
type LoginExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
instance string
|
|
}
|
|
|
|
func NewLoginExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *LoginExecutor {
|
|
exe := LoginExecutor{
|
|
FlagSet: flag.NewFlagSet("login", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("login", "Logs into an account on GoToSocial", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.instance, "instance", "", "The instance that you want to log into")
|
|
return &exe
|
|
}
|
|
|
|
// MuteExecutor is the executor for the mute command.
|
|
type MuteExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
muteDuration TimeDurationFlagValue
|
|
muteNotifications bool
|
|
resourceType string
|
|
}
|
|
|
|
func NewMuteExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *MuteExecutor {
|
|
exe := MuteExecutor{
|
|
FlagSet: flag.NewFlagSet("mute", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
muteDuration: NewTimeDurationFlagValue(),
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("mute", "Mutes a specific resource (e.g. an account)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.Var(&exe.muteDuration, "mute-duration", "Specify how long the mute should last for. To mute indefinitely, set this to 0s")
|
|
exe.BoolVar(&exe.muteNotifications, "mute-notifications", false, "Set to true to mute notifications as well as posts")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// RejectExecutor is the executor for the reject command.
|
|
type RejectExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
resourceType string
|
|
}
|
|
|
|
func NewRejectExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *RejectExecutor {
|
|
exe := RejectExecutor{
|
|
FlagSet: flag.NewFlagSet("reject", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("reject", "Rejects a request (e.g. a follow request)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// SwitchExecutor is the executor for the switch command.
|
|
type SwitchExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
to string
|
|
}
|
|
|
|
func NewSwitchExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *SwitchExecutor {
|
|
exe := SwitchExecutor{
|
|
FlagSet: flag.NewFlagSet("switch", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("switch", "Performs a switch operation (e.g. switching between logged in accounts)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.StringVar(&exe.to, "to", "", "TBC")
|
|
return &exe
|
|
}
|
|
|
|
// UnblockExecutor is the executor for the unblock command.
|
|
type UnblockExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
resourceType string
|
|
}
|
|
|
|
func NewUnblockExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *UnblockExecutor {
|
|
exe := UnblockExecutor{
|
|
FlagSet: flag.NewFlagSet("unblock", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("unblock", "Unblocks a resource (e.g. an account)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// UnfollowExecutor is the executor for the unfollow command.
|
|
type UnfollowExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
resourceType string
|
|
}
|
|
|
|
func NewUnfollowExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *UnfollowExecutor {
|
|
exe := UnfollowExecutor{
|
|
FlagSet: flag.NewFlagSet("unfollow", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("unfollow", "Unfollow a resource (e.g. an account)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// UnmuteExecutor is the executor for the unmute command.
|
|
type UnmuteExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
accountName string
|
|
resourceType string
|
|
}
|
|
|
|
func NewUnmuteExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *UnmuteExecutor {
|
|
exe := UnmuteExecutor{
|
|
FlagSet: flag.NewFlagSet("unmute", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("unmute", "Umutes a specific resource (e.g. an account)", exe.FlagSet)
|
|
|
|
exe.StringVar(&exe.accountName, "account-name", "", "The name of the account")
|
|
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
|
return &exe
|
|
}
|
|
|
|
// VersionExecutor is the executor for the version command.
|
|
type VersionExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
full bool
|
|
binaryVersion string
|
|
buildTime string
|
|
goVersion string
|
|
gitCommit string
|
|
}
|
|
|
|
func NewVersionExecutor(
|
|
printer *printer.Printer,
|
|
binaryVersion string,
|
|
buildTime string,
|
|
goVersion string,
|
|
gitCommit string,
|
|
) *VersionExecutor {
|
|
exe := VersionExecutor{
|
|
FlagSet: flag.NewFlagSet("version", flag.ExitOnError),
|
|
printer: printer,
|
|
binaryVersion: binaryVersion,
|
|
buildTime: buildTime,
|
|
goVersion: goVersion,
|
|
gitCommit: gitCommit,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("version", "Prints the application's version and build information", exe.FlagSet)
|
|
|
|
exe.BoolVar(&exe.full, "full", false, "Set to true to print the build information in full")
|
|
return &exe
|
|
}
|
|
|
|
// WhoamiExecutor is the executor for the whoami command.
|
|
type WhoamiExecutor struct {
|
|
*flag.FlagSet
|
|
printer *printer.Printer
|
|
config *config.Config
|
|
}
|
|
|
|
func NewWhoamiExecutor(
|
|
printer *printer.Printer,
|
|
config *config.Config,
|
|
) *WhoamiExecutor {
|
|
exe := WhoamiExecutor{
|
|
FlagSet: flag.NewFlagSet("whoami", flag.ExitOnError),
|
|
printer: printer,
|
|
config: config,
|
|
}
|
|
|
|
exe.Usage = commandUsageFunc("whoami", "Prints the account that you are currently logged into", exe.FlagSet)
|
|
|
|
return &exe
|
|
}
|