|
|
@ -25,6 +25,7 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
var outputFilename string
|
|
|
|
var outputFilename string
|
|
|
|
var isWwff bool
|
|
|
|
var isWwff bool
|
|
|
|
|
|
|
|
var isOverwrite bool
|
|
|
|
|
|
|
|
|
|
|
|
// adifCmd is executed when choosing the adif option (load and generate adif file)
|
|
|
|
// adifCmd is executed when choosing the adif option (load and generate adif file)
|
|
|
|
var adifCmd = &cobra.Command{
|
|
|
|
var adifCmd = &cobra.Command{
|
|
|
@ -42,17 +43,19 @@ func init() {
|
|
|
|
rootCmd.AddCommand(adifCmd)
|
|
|
|
rootCmd.AddCommand(adifCmd)
|
|
|
|
|
|
|
|
|
|
|
|
adifCmd.PersistentFlags().BoolVarP(&isWwff,"wwff", "w", false, "Generates an ADIF file ready to be uploaded on WWFF")
|
|
|
|
adifCmd.PersistentFlags().BoolVarP(&isWwff,"wwff", "w", false, "Generates an ADIF file ready to be uploaded on WWFF")
|
|
|
|
|
|
|
|
adifCmd.PersistentFlags().BoolVarP(&isOverwrite,"overWrite", "", false, "Overwrites the output file if it exisits")
|
|
|
|
adifCmd.PersistentFlags().StringVarP(&outputFilename, "output", "o", "", "Output filename")
|
|
|
|
adifCmd.PersistentFlags().StringVarP(&outputFilename, "output", "o", "", "Output filename")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func processAdifCommand(){
|
|
|
|
func processAdifCommand(){
|
|
|
|
|
|
|
|
|
|
|
|
verifiedOutputFilename, wasOK := buildOutputFilename(outputFilename,inputFilename,false)
|
|
|
|
verifiedOutputFilename, wasOK := buildOutputFilename(outputFilename,inputFilename,isOverwrite)
|
|
|
|
fmt.Println("adif called")
|
|
|
|
fmt.Println("adif called")
|
|
|
|
fmt.Println("Inputfile: ", inputFilename)
|
|
|
|
fmt.Println("Inputfile: ", inputFilename)
|
|
|
|
fmt.Println("OutputFile: ", outputFilename)
|
|
|
|
fmt.Println("OutputFile: ", outputFilename)
|
|
|
|
fmt.Println("computed output: ", verifiedOutputFilename)
|
|
|
|
fmt.Println("computed output: ", verifiedOutputFilename)
|
|
|
|
fmt.Println("Output wasOK: ", wasOK)
|
|
|
|
fmt.Println("Output wasOK: ", wasOK)
|
|
|
|
fmt.Println("wwff: ", isWwff)
|
|
|
|
fmt.Println("wwff: ", isWwff)
|
|
|
|
|
|
|
|
fmt.Println("isOverwrite: ", isOverwrite)
|
|
|
|
//loadFile()
|
|
|
|
//loadFile()
|
|
|
|
}
|
|
|
|
}
|