Gestionnaire de jobs et workflows
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.3 KiB

/*
------------------------------------------------------------------------------------------------------------------------
####### dune ####### Copyright (c) 2021 losyme ##################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package application
import "forge.chapril.org/losyme/cmdline"
type cmdLine struct {
demo bool
strValue string
runAfter func() error
}
func (app *Application) cmdlineInitialize(c *cmdline.CmdLine) {
cl := app.cmdLine
cmdDecrypt := cmdline.NewCmd(
"decrypt",
"decrypt string",
cmdline.WithRunFn(func() error {
cl.runAfter = app.decrypt
return nil
}),
)
cmdDecrypt.StringFlag(&cl.strValue, "string", "", "string to decrypt")
cmdEncrypt := cmdline.NewCmd(
"encrypt",
"encrypt string",
cmdline.WithRunFn(func() error {
cl.runAfter = app.encrypt
return nil
}),
)
cmdEncrypt.StringFlag(&cl.strValue, "string", "", "string to encrypt")
cmdSetup := cmdline.NewCmd(
"setup",
"application setup",
)
cmdSetup.BoolFlag(&cl.demo, "demo", false, "demonstration mode")
c.AddCmd(cmdDecrypt)
c.AddCmd(cmdEncrypt)
c.AddCmd(cmdSetup)
}
/*
######################################################################################################## @(°_°)@ #######
*/