Skip to content

Commit

Permalink
add shortcut flag to submit
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsdev0 committed Jul 29, 2024
1 parent 1749430 commit 9aff900
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
func init() {
rootCmd.AddCommand(runCmd)
runCmd.Flags().StringVarP(&submitBaseURL, "baseurl", "b", "", "set the base URL for HTTP tests, overriding any default")
runCmd.Flags().BoolVarP(&forceSubmit, "submit", "s", false, "shortcut flag to submit instead of run")
}

// runCmd represents the run command
Expand Down
3 changes: 2 additions & 1 deletion cmd/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

var submitBaseURL string
var forceSubmit bool

func init() {
rootCmd.AddCommand(submitCmd)
Expand All @@ -27,7 +28,7 @@ var submitCmd = &cobra.Command{

func submissionHandler(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
isSubmit := cmd.Name() == "submit"
isSubmit := cmd.Name() == "submit" || forceSubmit
lessonUUID := args[0]
optionalPositionalArgs := []string{}
if len(args) > 1 {
Expand Down

0 comments on commit 9aff900

Please # to comment.