Skip to content

Commit

Permalink
Feature: add --curl flag to CLI
Browse files Browse the repository at this point in the history
Signed-off-by: JeffMboya <[email protected]>
  • Loading branch information
JeffMboya committed May 28, 2024
1 parent 9e1d431 commit a50df69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ endif

install:
for file in $(BUILD_DIR)/*; do \
cp $$file $(GOBIN)/magistrala-`basename $$file`; \
cp $$file /usr/local/go/bin/magistrala-`basename $$file`; \
done

mocks:
Expand Down Expand Up @@ -260,4 +260,4 @@ run_addons: check_certs
$(foreach SVC,$(RUN_ADDON_ARGS),$(if $(filter $(SVC),$(ADDON_SERVICES) $(EXTERNAL_SERVICES)),,$(error Invalid Service $(SVC))))
@for SVC in $(RUN_ADDON_ARGS); do \
MG_ADDONS_CERTS_PATH_PREFIX="../." docker compose -f docker/addons/$$SVC/docker-compose.yml -p $(DOCKER_PROJECT) --env-file ./docker/.env $(DOCKER_COMPOSE_COMMAND) $(args) & \
done
done
2 changes: 2 additions & 0 deletions cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var (
Contact string = ""
// RawOutput raw output mode.
RawOutput bool = false
// Curl convert to curl command.
Curl bool = false
)

func logJSON(iList ...interface{}) {
Expand Down
7 changes: 7 additions & 0 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ func main() {
cli.RawOutput,
"Enables raw output mode for easier parsing of output",
)
rootCmd.PersistentFlags().BoolVarP(
&cli.Curl,
"curl",
"x",
cli.Curl,
"Convert HTTP request to cURL command",
)

// Client and Channels Flags
rootCmd.PersistentFlags().Uint64VarP(
Expand Down

0 comments on commit a50df69

Please sign in to comment.