Skip to content

Commit 005c915

Browse files
authored
feat(sync): Default input directory to '.' (#1869)
#### Summary The `gen` command defaults to writing configuration files to the current directory. I'd expect the `sync` command to have the same default. ---
1 parent d01e7ca commit 005c915

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cli/cmd/sync.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,18 @@ func NewCmdSync() *cobra.Command {
2626
Short: fetchShort,
2727
Long: fetchShort,
2828
Example: fetchExample,
29-
Args: cobra.ExactArgs(1),
29+
Args: cobra.MaximumNArgs(1),
3030
RunE: sync,
3131
}
3232
return cmd
3333
}
3434

3535
func sync(cmd *cobra.Command, args []string) error {
3636
ctx := cmd.Context()
37-
directory := args[0]
37+
directory := "."
38+
if len(args) > 0 {
39+
directory = args[0]
40+
}
3841
fmt.Println("Loading specs from directory: ", directory)
3942
specReader, err := specs.NewSpecReader(directory)
4043
if err != nil {

0 commit comments

Comments
 (0)