Skip to content

Commit d159ee2

Browse files
committed
Do not pass the command itself in the argument.
1 parent 1160ca4 commit d159ee2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

internal/librariangen/languagecontainer/languagecontainer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ type LanguageContainer struct {
4242
}
4343

4444
// Run accepts an implementation of the LanguageContainer.
45+
// The args parameter contains the command-line arguments passed to the container,
46+
// without including the program name. Usually it's os.Args[1:].
4547
func Run(args []string, container *LanguageContainer) int {
4648
// Logic to parse args and call the appropriate method on the container.
4749
// For example, if args[1] is "generate":

internal/librariangen/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func runCLI(args []string) int {
5252
Generate: generate.Generate,
5353
ReleaseInit: release.Init,
5454
}
55-
return languagecontainer.Run(args, &container)
55+
return languagecontainer.Run(args[1:], &container)
5656
}
5757

5858
func parseLogLevel(logLevelEnv string) slog.Level {

0 commit comments

Comments
 (0)