Skip to content

Commit

Permalink
feat: added apiType and url required flags to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilmhdh committed Jan 31, 2023
1 parent 1e99b6b commit bd47b67
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@ import (
)

func Run() {
var apiType string
var apiURL string

rootCmd := &cobra.Command{
Use: "apc",
Short: "One shot cli for your api schema security,performance and quality check",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("API Catalog CLI is running....")
fmt.Println(apiType)
},
}

rootCmd.PersistentFlags().StringVarP(&apiType, "apiType", "a", "", "Your API Type. Allowed values: rest | graphql")
rootCmd.MarkPersistentFlagRequired("apiType")

rootCmd.PersistentFlags().StringVar(&apiURL, "url", "", "URL or local file containing spec sheet")
rootCmd.MarkPersistentFlagRequired("url")

if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down

0 comments on commit bd47b67

Please sign in to comment.