added arguments data structure

This commit is contained in:
Hazel Noack 2025-07-16 11:27:32 +02:00
parent 81b960c231
commit 7f43eb43e0

View File

@ -11,6 +11,13 @@ type Program struct {
Name string Name string
Function ProgramFunction Function ProgramFunction
ShortDescription string ShortDescription string
Arguments []Argument
}
type Argument struct {
Name string
Type string
Required bool
Description string
} }
var HelpHeader = `This is the help page of transfem-startpage. var HelpHeader = `This is the help page of transfem-startpage.
@ -20,16 +27,40 @@ var Programs = []Program{
{ {
Name: "help", Name: "help",
ShortDescription: "get more information on how the cli in general or a specific program works", ShortDescription: "get more information on how the cli in general or a specific program works",
Arguments: []Argument{
{
Name: "program",
Type: "string",
Required: false,
Description: "defines the program you want to know more about",
},
},
}, },
{ {
Name: "start", Name: "start",
Function: Start, Function: Start,
ShortDescription: "start the webserver", ShortDescription: "start the webserver",
Arguments: []Argument{
{
Name: "profile",
Type: "string",
Required: false,
Description: "tells the program which config to load, default is 'default'",
},
},
}, },
{ {
Name: "cache", Name: "cache",
Function: Cache, Function: Cache,
ShortDescription: "do something with the cache", ShortDescription: "do something with the cache",
Arguments: []Argument{
{
Name: "action",
Type: "enum(clear;clean)",
Required: true,
Description: "defines what to do with the cache",
},
},
}, },
} }