2024-06-10 18:59:01 +01:00
|
|
|
// SPDX-FileCopyrightText: 2024 Dan Anglin <d.n.i.anglin@gmail.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
package executor
|
|
|
|
|
|
|
|
const (
|
|
|
|
CommandAccept string = "accept"
|
|
|
|
CommandAdd string = "add"
|
|
|
|
CommandBlock string = "block"
|
|
|
|
CommandCreate string = "create"
|
|
|
|
CommandDelete string = "delete"
|
|
|
|
CommandEdit string = "edit"
|
|
|
|
CommandFollow string = "follow"
|
2024-06-25 12:39:39 +01:00
|
|
|
CommandInit string = "init"
|
2024-06-10 18:59:01 +01:00
|
|
|
CommandLogin string = "login"
|
2024-06-18 04:59:32 +01:00
|
|
|
CommandMute string = "mute"
|
2024-06-10 18:59:01 +01:00
|
|
|
CommandReject string = "reject"
|
|
|
|
CommandRemove string = "remove"
|
|
|
|
CommandShow string = "show"
|
|
|
|
CommandSwitch string = "switch"
|
|
|
|
CommandUnblock string = "unblock"
|
|
|
|
CommandUnfollow string = "unfollow"
|
2024-06-18 04:59:32 +01:00
|
|
|
CommandUnmute string = "unmute"
|
2024-06-10 18:59:01 +01:00
|
|
|
CommandVersion string = "version"
|
|
|
|
CommandWhoami string = "whoami"
|
|
|
|
|
|
|
|
commandAcceptSummary string = "Accept a request (e.g. a follow request)"
|
|
|
|
commandAddSummary string = "Add a resource to another resource"
|
|
|
|
commandBlockSummary string = "Block a resource (e.g. an account)"
|
|
|
|
commandCreateSummary string = "Create a specific resource"
|
|
|
|
commandDeleteSummary string = "Delete a specific resource"
|
|
|
|
commandEditSummary string = "Edit a specific resource"
|
|
|
|
commandFollowSummary string = "Follow a resource (e.g. an account)"
|
2024-06-25 12:39:39 +01:00
|
|
|
commandInitSummary string = "Create a new configuration file in the specified configuration directory"
|
2024-06-10 18:59:01 +01:00
|
|
|
commandLoginSummary string = "Login to an account on GoToSocial"
|
2024-06-18 04:59:32 +01:00
|
|
|
commandMuteSummary string = "Mute a resource (e.g. an account)"
|
2024-06-10 18:59:01 +01:00
|
|
|
commandRejectSummary string = "Reject a request (e.g. a follow request)"
|
|
|
|
commandRemoveSummary string = "Remove a resource from another resource"
|
|
|
|
commandShowSummary string = "Print details about a specified resource"
|
|
|
|
commandSwitchSummary string = "Perform a switch operation (e.g. switch logged in accounts)"
|
|
|
|
commandUnblockSummary string = "Unblock a resource (e.g. an account)"
|
|
|
|
commandUnfollowSummary string = "Unfollow a resource (e.g. an account)"
|
2024-06-18 04:59:32 +01:00
|
|
|
commandUnmuteSummary string = "Unmute a resource (e.g. an account)"
|
2024-06-10 18:59:01 +01:00
|
|
|
commandVersionSummary string = "Print the application's version and build information"
|
|
|
|
commandWhoamiSummary string = "Print the account that you are currently logged in to"
|
|
|
|
)
|
|
|
|
|
|
|
|
func CommandSummaryMap() map[string]string {
|
|
|
|
return map[string]string{
|
|
|
|
CommandAccept: commandAcceptSummary,
|
|
|
|
CommandAdd: commandAddSummary,
|
|
|
|
CommandBlock: commandBlockSummary,
|
|
|
|
CommandCreate: commandCreateSummary,
|
|
|
|
CommandDelete: commandDeleteSummary,
|
|
|
|
CommandEdit: commandEditSummary,
|
|
|
|
CommandFollow: commandFollowSummary,
|
2024-06-25 12:39:39 +01:00
|
|
|
CommandInit: commandInitSummary,
|
2024-06-10 18:59:01 +01:00
|
|
|
CommandLogin: commandLoginSummary,
|
2024-06-18 04:59:32 +01:00
|
|
|
CommandMute: commandMuteSummary,
|
2024-06-10 18:59:01 +01:00
|
|
|
CommandReject: commandRejectSummary,
|
|
|
|
CommandRemove: commandRemoveSummary,
|
|
|
|
CommandShow: commandShowSummary,
|
|
|
|
CommandSwitch: commandSwitchSummary,
|
|
|
|
CommandUnblock: commandUnblockSummary,
|
|
|
|
CommandUnfollow: commandUnfollowSummary,
|
2024-06-18 04:59:32 +01:00
|
|
|
CommandUnmute: commandUnmuteSummary,
|
2024-06-10 18:59:01 +01:00
|
|
|
CommandVersion: commandVersionSummary,
|
|
|
|
CommandWhoami: commandWhoamiSummary,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func CommandSummaryLookup(command string) string {
|
|
|
|
commandMap := CommandSummaryMap()
|
|
|
|
|
|
|
|
summary, ok := commandMap[command]
|
|
|
|
if !ok {
|
|
|
|
return "This command does not have a summary"
|
|
|
|
}
|
|
|
|
|
|
|
|
return summary
|
|
|
|
}
|