From d3fdfdcdc528641fffdc3595d4026e7d75bc9dda Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Wed, 28 May 2025 10:00:12 +0200 Subject: [PATCH] comments & sorting flags Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- main.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index b544995..9fcf826 100644 --- a/main.go +++ b/main.go @@ -38,13 +38,20 @@ func main() { &maxRepoSize, "max-size", 150, - "Limit the size of repositories to scan (in MB) (Only for deep scan)", + "Limit the size of repositories to scan (in MB) (only for deep scan)", ) flag.StringVar( &excludeRepos, "exclude-repo", "", - "Exclude repos from deep scan (comma-separated list)", + "Exclude repos from deep scan (comma-separated list, only for deep scan)", + ) + flag.BoolVarP( + &refresh, + "refresh", + "r", + false, + "Refresh the cache (only for deep scan)", ) flag.BoolVarP( &onlyCommitsLeak, @@ -53,13 +60,6 @@ func main() { false, "Display only commits with author info", ) - flag.BoolVarP( - &refresh, - "refresh", - "r", - false, - "Refresh the cache (deep scan only)", - ) flag.BoolVarP(&silent, "silent", "s", false, "Suppress all non-essential output") flag.StringVarP(&jsonFile, "json", "j", "", "Write results to specified JSON file") @@ -69,6 +69,8 @@ func main() { flag.Parse() + // INITIALIZE RECON OBJECT + r := &ghrecon.Recon{ Client: github.NewClient(nil), Logger: log.NewWithOptions(os.Stderr, log.Options{ @@ -81,6 +83,8 @@ func main() { MaxRepoSize: maxRepoSize, } + // CHECK FLAGS + if username == "" && fromEmail == "" { r.Logger.Fatal( "Please provide a username with the --username (-u) flag or an email with the --email (-e) flag", @@ -101,6 +105,8 @@ func main() { r.Client = r.Client.WithAuthToken(token) } + // START + r.Header() if fromEmail != "" {