feat: add eval command shorthand and reorder snapshot-release tasks

- Add top-level 'eval' command as shorthand for 'func eval' with multiple aliases (e, ev, evl, evla)
- Reorder Makefile snapshot-release to copy registry metadata before building binary
- Update contact URL in Swagger docs from osmedeus/osmedeus to osmedeus
- Update registry metadata with katana v1.4.0 (web crawling and spidering framework)
This commit is contained in:
j3ssie
2026-01-21 18:13:47 +08:00
parent da0085df7b
commit e4fa681a9b
5 changed files with 45 additions and 4 deletions
+19
View File
@@ -57,6 +57,15 @@ var functionListCmd = &cobra.Command{
RunE: runFunctionList,
}
// evalCmd is a top-level shorthand for 'func eval'
var evalCmd = &cobra.Command{
Use: "eval",
Aliases: []string{"e", "ev", "evl", "evla"},
Short: "Evaluate a script (shorthand for 'func eval')",
Long: UsageFunctionEval(),
RunE: runFunctionEval,
}
func init() {
functionEvalCmd.Flags().StringVarP(&evalScript, "eval", "e", "", "script to evaluate")
functionEvalCmd.Flags().StringVarP(&evalTarget, "target", "t", "", "target value for {{target}} variable")
@@ -73,6 +82,16 @@ func init() {
functionListCmd.Flags().IntVar(&funcColumnWidth, "width", 60, "max column width (wraps lines instead of truncating)")
functionListCmd.Flags().BoolVar(&funcShowExample, "example", false, "show example usage below each function description")
// evalCmd flags (same as functionEvalCmd - it's a shorthand)
evalCmd.Flags().StringVarP(&evalScript, "eval", "e", "", "script to evaluate")
evalCmd.Flags().StringVarP(&evalTarget, "target", "t", "", "target value for {{target}} variable")
evalCmd.Flags().StringArrayVar(&evalParams, "params", nil, "additional parameters (key=value format)")
evalCmd.Flags().BoolVar(&evalStdin, "stdin", false, "read script from stdin")
evalCmd.Flags().StringVarP(&evalFunctionName, "function", "f", "", "function name to call (remaining args become function arguments)")
evalCmd.Flags().StringVarP(&funcTargetsFile, "targets", "T", "", "file containing targets (one per line)")
evalCmd.Flags().StringVar(&funcFunctionFile, "function-file", "", "file containing the function/script to execute")
evalCmd.Flags().IntVarP(&funcConcurrency, "concurrency", "c", 1, "number of concurrent executions")
functionCmd.AddCommand(functionEvalCmd)
functionCmd.AddCommand(functionListCmd)
}