Adding a new capability#
By design, networkscan breaks every unique network scan into its own top level command. If you are looking to add a brand new capability to the tool, you can take the following steps.
- Add a file to
cmd/
that corresponds to the sub-command name you'd like to add to thenetworkscan
CLI - You can use
cmd/port.go
as a template - Your file needs to be a member function of the
networkscan
struct and should be of the formInit<cmd>Command
- Add a new member to the
networkscan
struct incmd/root.go
that corresponsds to your command name. Remember, the first letter must be capitalized. - Call your
Init
function frommain.go
- Add logic to your commands runtime and put it in its own package within
internal
(e.g.,internal/port
)