-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from projectdiscovery/dev
v0.1.3
- Loading branch information
Showing
4 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/projectdiscovery/goflags" | ||
) | ||
|
||
type Options struct { | ||
name string | ||
Email goflags.StringSlice | ||
Phone string | ||
Address goflags.StringSlice | ||
} | ||
|
||
func main() { | ||
testOptions := &Options{} | ||
flagSet := goflags.NewFlagSet() | ||
flagSet.CreateGroup("info", "Info", | ||
flagSet.StringVarP(&testOptions.name, "name", "n", "", "name of the user"), | ||
flagSet.StringSliceVarP(&testOptions.Email, "email", "e", nil, "email of the user", goflags.CommaSeparatedStringSliceOptions), | ||
) | ||
flagSet.CreateGroup("additional", "Additional", | ||
flagSet.StringVarP(&testOptions.Phone, "phone", "ph", "", "phone of the user"), | ||
flagSet.StringSliceVarP(&testOptions.Address, "address", "add", nil, "address of the user", goflags.StringSliceOptions), | ||
) | ||
|
||
if err := flagSet.Parse(); err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters