-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2327 from carapace-sh/add-bru
added bru
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var rootCmd = &cobra.Command{ | ||
Use: "bru", | ||
Short: "Bruno CLI", | ||
Long: "https://docs.usebruno.com/bru-cli/overview", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func Execute() error { | ||
return rootCmd.Execute() | ||
} | ||
func init() { | ||
carapace.Gen(rootCmd).Standalone() | ||
|
||
rootCmd.Flags().BoolP("help", "h", false, "Show help") | ||
rootCmd.Flags().Bool("version", false, "Show version number") | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var runCmd = &cobra.Command{ | ||
Use: "run", | ||
Short: "Run a request", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(runCmd).Standalone() | ||
|
||
runCmd.Flags().Bool("bail", false, "Stop execution after a failure of a request, test, or assertion") | ||
runCmd.Flags().String("cacert", "", "CA certificate to verify peer against") | ||
runCmd.Flags().String("env", "", "Environment variables") | ||
runCmd.Flags().String("env-var", "", "Overwrite a single environment variable, multiple usages possible") | ||
runCmd.Flags().StringP("format", "f", "", "Format of the file results") | ||
runCmd.Flags().BoolP("help", "h", false, "Show help") | ||
runCmd.Flags().Bool("insecure", false, "Allow insecure server connections") | ||
runCmd.Flags().StringP("output", "o", "", "Path to write file results to") | ||
runCmd.Flags().BoolS("r", "r", false, "Indicates a recursive run") | ||
runCmd.Flags().Bool("tests-only", false, "Only run requests that have a test") | ||
runCmd.Flags().Bool("version", false, "Show version number") | ||
rootCmd.AddCommand(runCmd) | ||
|
||
carapace.Gen(runCmd).FlagCompletion(carapace.ActionMap{ | ||
"cacert": carapace.ActionFiles(), | ||
"env": carapace.ActionValues(), // TODO | ||
"env-var": carapace.ActionValues(), // TODO | ||
"format": carapace.ActionValues("json", "junit", "html"), | ||
"output": carapace.ActionFiles(), | ||
}) | ||
|
||
carapace.Gen(runCmd).PositionalCompletion( | ||
carapace.ActionFiles(".bru"), | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "github.com/carapace-sh/carapace-bin/completers/bru_completer/cmd" | ||
|
||
func main() { | ||
cmd.Execute() | ||
} |