-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: Cannot embed machine room as a cobra subcommand because fisk and cobra fight over os.Args Solution: Add a CustomArgs and CustomArgsEnabled machine room option to pass args through. Result: Machine room can run as a cobra subcommand: ```go cmd := &cobra.Command{ Args: cobra.ArbitraryArgs, DisableFlagParsing: true, RunE: func(cmd *cobra.Command, args []string) error { app, _ := mr.New(mr.Options{ CustomArgsEnabled: true, CustomArgs: args, }) return app.Run(cmd.Context()) }, } ```
- Loading branch information
1 parent
dbd9249
commit e112acb
Showing
3 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters