-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor] Nil pointer check and some improvements #11
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command parameters should not be marked as required. A better approach would be to check if both parameters are empty, and then throwing an error.
@@ -21,7 +21,9 @@ func initTracerCommand() *cobra.Command { | |||
tracerCMD.Flags().Bool("allow-local-ranges", true, "allows access to local IP ranges") | |||
tracerCMD.Flags().Bool("allow-github-meta", false, "allows access to GitHub meta IP ranges (https://api.github.com/meta)") | |||
tracerCMD.Flags().String("allowed-hosts", "", "enter allowed hostnames (example.com, .github.com)") | |||
tracerCMD.MarkFlagRequired("allowed-hosts") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be marked as required.
The tool can be run in monitor mode.
The allowed IP might have passed.
tracerCMD.Flags().String("allowed-ips", "", "enter allowed IP addresses") | ||
tracerCMD.MarkFlagRequired("allowed-ips") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be marked as required.
The tool can be run in monitor mode.
The allowed Hosts might have passed.
No description provided.