From 2ba86956740d9868267175d3abc75ea5fbcd9ac7 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Wed, 28 May 2025 09:44:49 +0200 Subject: [PATCH] edit flags sorting Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- main.go | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/main.go b/main.go index 572fdef..dd356e6 100644 --- a/main.go +++ b/main.go @@ -31,15 +31,30 @@ func main() { var excludeRepos string var maxRepoSize int var refresh bool + + // FLAGS flag.StringVarP(&username, "username", "u", "", "GitHub username to analyze") flag.StringVarP(&token, "token", "t", "", "GitHub personal access token (e.g. ghp_...)") flag.StringVarP(&fromEmail, "email", "e", "", "Search accounts by email address") + flag.BoolVarP( + &deep, + "deep", + "d", + false, + "Enable deep scan (clone repos, regex search, analyse licenses, etc.)", + ) flag.IntVar( &maxRepoSize, "max-size", 150, "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)", + ) flag.BoolVarP( &onlyCommitsLeak, "only-commits", @@ -54,22 +69,13 @@ func main() { false, "Refresh the cache (deep scan only)", ) - flag.BoolVarP( - &deep, - "deep", - "d", - false, - "Enable deep scan (clone repos, regex search, analyse licenses, etc.)", - ) flag.BoolVarP(&silent, "silent", "s", false, "Suppress all non-essential output") flag.StringVarP(&jsonFile, "json", "j", "", "Write results to specified JSON file") - flag.StringVar( - &excludeRepos, - "exclude-repo", - "", - "Exclude repos from deep scan (comma-separated list)", - ) + + // FLAGS SETTINGS flag.CommandLine.SetNormalizeFunc(wordSepNormalizeFunc) + flag.CommandLine.SortFlags = false + flag.Parse() styles := log.DefaultStyles()