31 lines
859 B
Go
Executable File
31 lines
859 B
Go
Executable File
package generate
|
|
|
|
import (
|
|
"tildegit.org/PigeonProtocolConsortium/pigeongo/internal/codec"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
seqConf = struct{
|
|
Layer, Depth uint
|
|
Sequences []uint
|
|
}
|
|
seqCmd = cobra.Command{
|
|
Use: "seq",
|
|
Short: "Generate Lipmaa Layer Sequences",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println(code.CalculateLipmaaLayerSequence(
|
|
seqConf.Layer, seqConf.Depth, seqConf.Sequences
|
|
))
|
|
}
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
seqCmd.Flags().UintVarP(*seqConf.Layer, "layer", "l", uint(1),
|
|
"The layer that you would like to start the sequence generation from")
|
|
seqCmd.Flags().UintVarP(*seqConf.Depth, "depth", "d", uint(1),
|
|
"The Layer that you would like to stop the sequence generation at")
|
|
seqCmd.Flags().UintSliceVarP(*seqConf.Sequences, "sequences", "s", []uint{0},
|
|
"A list of sequences that you'de like to start with")
|
|
} |