csvtool/commands.go

40 lines
1.5 KiB
Go
Raw Normal View History

package main
// Command represents a command that can be executed in the application.
type Command struct {
ID string `json:"ID"`
Name string `json:"Name"`
Shortcut string `json:"Shortcut"`
}
// CommandRegistry provides command metadata to the frontend.
type CommandRegistry struct{}
// NewCommandRegistry creates a new CommandRegistry.
func NewCommandRegistry() *CommandRegistry {
return &CommandRegistry{}
}
// GetCommands returns the list of all available commands.
func (c *CommandRegistry) GetCommands() []Command {
return []Command{
{ID: "copy", Name: "Copy", Shortcut: "Cmd+C"},
{ID: "cut", Name: "Cut", Shortcut: "Cmd+X"},
{ID: "copy-markdown", Name: "Copy as Markdown", Shortcut: ""},
{ID: "copy-jira", Name: "Copy as Jira", Shortcut: ""},
{ID: "paste", Name: "Paste", Shortcut: "Cmd+V"},
{ID: "resize-all", Name: "Resize All Columns", Shortcut: ""},
{ID: "open", Name: "Open File", Shortcut: "Cmd+O"},
{ID: "save", Name: "Save File", Shortcut: "Cmd+S"},
{ID: "open-up", Name: "Insert Row Above", Shortcut: ""},
{ID: "open-down", Name: "Insert Row Below", Shortcut: ""},
{ID: "open-left", Name: "Insert Column Left", Shortcut: ""},
{ID: "open-right", Name: "Insert Column Right", Shortcut: ""},
{ID: "sort-asc", Name: "Sort A-Z", Shortcut: ""},
{ID: "sort-desc", Name: "Sort Z-A", Shortcut: ""},
{ID: "sort-advanced", Name: "Sort Advanced", Shortcut: ""},
{ID: "match-cell", Name: "Match Cell", Shortcut: "Cmd+M"},
{ID: "delete-row", Name: "Delete Row", Shortcut: "Cmd+Backspace"},
}
}