From fba1a5fca935ad8a0da7fa7f322e14e033960a0f Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Fri, 11 Nov 2022 12:53:32 +0100 Subject: [PATCH] Change open cmd to default to current directory fixes #1069 --- cmd/open.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/open.go b/cmd/open.go index dd41a3cf6..627eac639 100644 --- a/cmd/open.go +++ b/cmd/open.go @@ -15,9 +15,13 @@ var openCmd = &cobra.Command{ Pass the path to the directory that contains the solution you want to see on the website. `, - Args: cobra.ExactArgs(1), + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - metadata, err := workspace.NewExerciseMetadata(args[0]) + path := "." + if len(args) == 1 { + path = args[0] + } + metadata, err := workspace.NewExerciseMetadata(path) if err != nil { return err }