From e49f8ea4b0078cc83084bce64837537c21041f33 Mon Sep 17 00:00:00 2001 From: Nguyen Marc Date: Mon, 5 Feb 2024 16:21:27 +0100 Subject: [PATCH] feat(cli): remove jobname requirement --- cli/cmd/submit/submit.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/cmd/submit/submit.go b/cli/cmd/submit/submit.go index a7d20dde..85dbb1a3 100644 --- a/cli/cmd/submit/submit.go +++ b/cli/cmd/submit/submit.go @@ -77,6 +77,7 @@ import ( "math/big" "os" "os/signal" + "path/filepath" "regexp" "strings" "syscall" @@ -205,8 +206,7 @@ var flags = []cli.Flag{ }, &cli.StringFlag{ Name: "job-name", - Usage: "The job name.", - Required: true, + Usage: "The job name. (If empty, defaults to the job file name.)", Destination: &jobName, Category: "Submit Settings:", }, @@ -290,6 +290,9 @@ var Command = cli.Command{ return errors.New("missing --credits or --credits-wei parameter") } jobPath := cCtx.Args().First() + if jobName == "" { + jobName = filepath.Base(strings.TrimSuffix(jobPath, filepath.Ext(jobPath))) + } ctx := cCtx.Context pk, err := utils.GetPrivateKey(ethHexPK, ethHexPKPath) if err != nil {