mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
5 years ago
|
package main
|
||
5 years ago
|
|
||
5 years ago
|
import (
|
||
5 years ago
|
"lib"
|
||
5 years ago
|
)
|
||
5 years ago
|
|
||
|
type node struct {
|
||
|
flags []string
|
||
|
flagsShorthand []string
|
||
|
randArgFlag []string
|
||
|
randArg []string
|
||
|
}
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
s := []string{"--insert=", "--order"}
|
||
5 years ago
|
strShorthand := []string{"-i=", "-o"}
|
||
|
var randflag []string
|
||
|
var randflagarg []string
|
||
|
for i := 0; i < 2; i++ {
|
||
5 years ago
|
randflagarg = append(randflagarg, lib.RandWords())
|
||
|
randflag = append(randflag, lib.RandWords())
|
||
5 years ago
|
}
|
||
|
|
||
|
node := &node{
|
||
5 years ago
|
flags: s,
|
||
5 years ago
|
flagsShorthand: strShorthand,
|
||
|
randArgFlag: randflagarg,
|
||
|
randArg: randflag,
|
||
|
}
|
||
|
|
||
|
node.randArg = append(node.randArg, "")
|
||
|
|
||
5 years ago
|
lib.ChallengeMain("flags", node.flagsShorthand[0]+"v2", "v1")
|
||
|
lib.ChallengeMain("flags", node.flagsShorthand[1], "v1")
|
||
|
lib.ChallengeMain("flags", "-h")
|
||
|
lib.ChallengeMain("flags", "--help")
|
||
|
lib.ChallengeMain("flags")
|
||
5 years ago
|
|
||
|
for _, v2 := range node.randArgFlag {
|
||
|
for _, v1 := range node.randArg {
|
||
5 years ago
|
lib.ChallengeMain("flags", node.flags[0]+v2, node.flags[1], v1)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
for _, v2 := range node.randArgFlag {
|
||
|
for _, v1 := range node.randArg {
|
||
5 years ago
|
lib.ChallengeMain("flags", node.flagsShorthand[0]+v2, node.flagsShorthand[1], v1)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
}
|