Skip to content

Conversation

@RamanaReddy0M
Copy link
Contributor

No description provided.

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requesting some changes !!

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation lgtm!
Suggesting some changes

  • create examples/main.go that uses these callbacks
  • add it to gh build workflow

Ref:https://github.com/projectdiscovery/tlsx

- Add example to gh workflow
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!
this helper function and goflags callbackvar will be used in following way across all tools

pdtm/examples/main.go

Lines 16 to 32 in 87dc669

flagSet := goflags.NewFlagSet()
toolName := "nuclei"
flagSet.CreateGroup("update", "Update",
flagSet.CallbackVarP(utils.GetUpdaterCallback(toolName), "update", "up", fmt.Sprintf("update %v to the latest released version", toolName)),
flagSet.BoolVarP(&options.DisableUpdateCheck, "disable-update-check", "duc", false, "disable automatic update check"),
)
if err := flagSet.Parse(); err != nil {
panic(err)
}
if !options.DisableUpdateCheck {
msg := utils.GetVersionCheckCallback(toolName)()
fmt.Println(msg)
}
}

@tarunKoyalwar tarunKoyalwar removed the request for review from ShubhamRasal March 2, 2023 06:49
@tarunKoyalwar tarunKoyalwar requested review from ehsandeep and removed request for tarunKoyalwar March 3, 2023 06:54
@ehsandeep ehsandeep merged commit c3263fc into dev Mar 3, 2023
@ehsandeep ehsandeep deleted the issuse-79-add-callback-helpers branch March 3, 2023 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Helper Function that returns callback of given tool

5 participants