Simplify CLI user interface

pull/29/head v0.1.0
Jean-Marc MEESSEN 4 years ago committed by GitHub
parent 6134577dd0
commit 0b9fb5bc78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
.gitignore vendored

@ -7,6 +7,7 @@
FLEcli
test/output/temp/*
dist/*
notes/help.txt
# Test binary, built with `go test -c`
*.test

@ -18,7 +18,7 @@ builds:
- goos: windows
goarch: amd64
ldflags:
- -s -w -X FLEcli/cmd.version={{.Version}} -X FLEcli/cmd.commit={{.Commit}} -X FLEcli/cmd.date={{.Date}} -X=FLEcli/cmd.builtBy=goReleaser
- -s -w -X FLEcli/flecmd.version={{.Version}} -X FLEcli/flecmd.commit={{.Commit}} -X FLEcli/flecmd.date={{.Date}} -X=FLEcli/flecmd.builtBy=goReleaser
env:
- CGO_ENABLED=0

@ -36,7 +36,7 @@ Most comon use cases are described hereafter as examples.
To load and validate the FLE formated file (`myActivation.txt`:
```
./FLEcli load -i=myActivation.txt
./FLEcli load myActivation.txt
```
This command will parse and display the QSOs in grid format.
Fields that couldn't be successfully parsed are prefixed with "*".
@ -48,21 +48,21 @@ Parsing errors or doubts are listed at the end of the list.
To generate an ADIF file based on `activation.txt`:
```
./FLEcli adif -i activation.txt -o output/activation.adi --overwrite --interpolate
./FLEcli adif -i --overwrite activation.txt output/activation.adi
```
The `-o` (or the long form, `--output`) specifies the path and name of the output file.
If the flag and value are omitted, the tool will generate a filename.
The second element after the input specifies the path and name of the output file.
If is omitted, the tool will generate a filename.
It is based on the input filename, just replacing the extension with `.adi`.
The `--overwrite` flag indicates that, if the output file already exists, it should be overwritten.
The `-o` or `--overwrite` flag indicates that, if the output file already exists, it should be overwritten.
The `--interpolate` flag will interpolate the missing non-entered times based on the first and the last entered time.
The `-i` or `--interpolate` flag will interpolate the missing non-entered times based on the first and the last entered time.
### Example: generate an ADIF file for WWFF upload
To generate a WWFF-ready ADIF file:
```
./FLEcli adif -i ON4KJM@ONFF-025920200524.txt --wwff --interpolate
./FLEcli adif -i --wwff ON4KJM@ONFF-025920200524.txt
```
The `--wwff` indicates the adif flavour to produce.
You can use the `--sota` switch to generate an ADIF file containing SOTA details.
@ -76,7 +76,11 @@ As we didn't provide an output filename, the default output, `ON4KJM@ONFF-025920
To generate a CSV file that can be uploaded to https://www.sotadata.org.uk/ to report SOTA activations:
```
./FLEcli csv -i sotaActivation.txt --overwrite --interpolate
./FLEcli csv --interpolate --overwrite sotaActivation.txt
```
or the short form
```
./FLEcli csv -i -o sotaActivation.txt
```
This command will generate `sotaActivation.csv` based on the `sotaActivation.txt` FLE logfile.
If the output file exists, it will be overwritten as the `--overwrite` flag has been specified.

@ -8,4 +8,4 @@ commitRef=$(git rev-parse HEAD)
tag=$(git describe --tags)
version="${tag}_(PrivateBuild)"
buildDate=$(date -u +"%FT%TZ")
go build -ldflags="-s -w -X=FLEcli/cmd.version=${version} -X=FLEcli/cmd.commit=${commitRef} -X=FLEcli/cmd.date=${buildDate} -X=FLEcli/cmd.builtBy=${USER}"
go build -ldflags="-s -w -X=FLEcli/flecmd.version=${version} -X=FLEcli/flecmd.commit=${commitRef} -X=FLEcli/flecmd.date=${buildDate} -X=FLEcli/flecmd.builtBy=${USER}"

@ -1,93 +0,0 @@
package cmd
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import (
"fmt"
"github.com/spf13/cobra"
// "log"
//"strings"
)
var outputFilename string
var isWWFFcli bool
var isSOTAcli bool
var isOverwrite bool
// adifCmd is executed when choosing the adif option (load and generate adif file)
var adifCmd = &cobra.Command{
Use: "adif",
Short: "Generates an ADIF file based on a FLE type shorthand logfile.",
// Long: `A longer description that spans multiple lines and likely contains examples
// and usage of using your command. For example:
Run: func(cmd *cobra.Command, args []string) {
processAdifCommand()
},
}
func init() {
rootCmd.AddCommand(adifCmd)
adifCmd.PersistentFlags().StringVarP(&inputFilename, "input", "i", "", "FLE formatted input file (mandatory)")
adifCmd.MarkPersistentFlagRequired("input")
adifCmd.PersistentFlags().BoolVarP(&isInterpolateTime, "interpolate", "", false, "Interpolates the missing time entries.")
adifCmd.PersistentFlags().BoolVarP(&isWWFFcli, "wwff", "w", false, "Generates a WWFF ready ADIF file.")
adifCmd.PersistentFlags().BoolVarP(&isSOTAcli, "sota", "s", false, "Generates a SOTA ready ADIF file.")
adifCmd.PersistentFlags().BoolVarP(&isOverwrite, "overwrite", "", false, "Overwrites the output file if it exisits")
adifCmd.PersistentFlags().StringVarP(&outputFilename, "output", "o", "", "Output filename")
}
func processAdifCommand() {
verifiedOutputFilename, filenameWasOK := buildOutputFilename(outputFilename, inputFilename, isOverwrite, ".adi")
// if the output file could not be parsed correctly do noting
if filenameWasOK {
loadedLogFile, isLoadedOK := loadFile()
//TODO: move this in a function so that it can be more easily tested
if isLoadedOK {
if len(loadedLogFile) == 0 {
fmt.Println("No useful data read. Aborting...")
return
}
//TODO: There are more tests required here
//check if we have the necessary information for the type
if isWWFFcli {
if loadedLogFile[0].MyWWFF == "" {
fmt.Println("Missing MY-WWFF reference. Aborting...")
return
}
if loadedLogFile[0].Operator == "" {
fmt.Println("Missing Operator. Aborting...")
return
}
}
if isSOTAcli {
if loadedLogFile[0].MySOTA == "" {
fmt.Println("Missing MY-SOTA reference. Aborting...")
return
}
}
outputAdif(verifiedOutputFilename, loadedLogFile, isWWFFcli, isSOTAcli)
}
}
}

@ -1,7 +1,10 @@
# Usage
## Overview
```
A Command Line "Fast Log Entry" (FLE) processor
Usage:
FLEcli [command]
@ -22,16 +25,14 @@ Use "FLEcli [command] --help" for more information about a command.
## "LOAD" command
```
FLEcli load --help
Loads and validates a FLE type shorthand logfile
Usage:
FLEcli load [flags]
FLEcli load [flags] inputFile
Flags:
-h, --help help for load
-i, --input string FLE formatted input file (mandatory)
--interpolate Interpolates the missing time entries.
-i, --interpolate Interpolates the missing time entries.
Global Flags:
--config string config file (default is $HOME/.FLEcli.yaml)
@ -40,18 +41,15 @@ Global Flags:
## "ADIF" command
```
FLEcli adif --help
Generates an ADIF file based on a FLE type shorthand logfile.
Usage:
FLEcli adif [flags]
FLEcli adif [flags] inputFile [outputFile]
Flags:
-h, --help help for adif
-i, --input string FLE formatted input file (mandatory)
--interpolate Interpolates the missing time entries.
-o, --output string Output filename
--overwrite Overwrites the output file if it exisits
-i, --interpolate Interpolates the missing time entries.
-o, --overwrite Overwrites the output file if it exisits
-s, --sota Generates a SOTA ready ADIF file.
-w, --wwff Generates a WWFF ready ADIF file.
@ -59,28 +57,26 @@ Global Flags:
--config string config file (default is $HOME/.FLEcli.yaml)
```
## "CSV" command
```
FLEcli csv --help
Generates a SOTA .csv file based on a FLE type shorthand logfile.
Usage:
FLEcli csv [flags]
FLEcli csv [flags] inputFile [outputFile]
Flags:
-h, --help help for csv
-i, --input string FLE formatted input file (mandatory)
--interpolate Interpolates the missing time entries.
-o, --output string Output filename
--overwrite Overwrites the output file if it exisits
-i, --interpolate Interpolates the missing time entries.
-o, --overwrite Overwrites the output file if it exisits
Global Flags:
--config string config file (default is $HOME/.FLEcli.yaml)
```
## "VERSION" command
```
FLEcli version --help
"version" will output the current build information
Usage:
@ -93,4 +89,4 @@ Flags:
Global Flags:
--config string config file (default is $HOME/.FLEcli.yaml)
```
The normal output looks like `FLEcli version: v0.0.1`. The detailled output gives additionaly the Git commit hash. the date and time of build and who built the release.
The normal output looks like `FLEcli version: v0.1.2`. The detailled output gives additionaly the Git commit hash. the date and time of build and who built the release.

@ -0,0 +1,71 @@
package flecmd
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import (
"FLEcli/fleprocess"
"fmt"
"github.com/spf13/cobra"
)
var outputFilename string
var isWWFFcli bool
var isSOTAcli bool
var isOverwrite bool
// adifCmd is executed when choosing the adif option (load and generate adif file)
var adifCmd = &cobra.Command{
Use: "adif [flags] inputFile [outputFile]",
Short: "Generates an ADIF file based on a FLE type shorthand logfile.",
// Long: `A longer description that spans multiple lines and likely contains examples
// and usage of using your command. For example:
RunE: func(cmd *cobra.Command, args []string) error {
//if args is empty, throw an error
if len(args) == 0 {
//TODO: fix this ugly statement (because I am lazy)
return fmt.Errorf("Missing input file %s", "")
}
inputFilename = args[0]
if len(args) == 2 {
outputFilename = args[1]
}
if len(args) > 2 {
return fmt.Errorf("Too many arguments.%s", "")
}
fleprocess.ProcessAdifCommand(
inputFilename,
outputFilename,
isInterpolateTime,
isWWFFcli,
isSOTAcli,
isOverwrite)
return nil
},
}
func init() {
rootCmd.AddCommand(adifCmd)
adifCmd.PersistentFlags().BoolVarP(&isInterpolateTime, "interpolate", "i", false, "Interpolates the missing time entries.")
adifCmd.PersistentFlags().BoolVarP(&isWWFFcli, "wwff", "w", false, "Generates a WWFF ready ADIF file.")
adifCmd.PersistentFlags().BoolVarP(&isSOTAcli, "sota", "s", false, "Generates a SOTA ready ADIF file.")
adifCmd.PersistentFlags().BoolVarP(&isOverwrite, "overwrite", "o", false, "Overwrites the output file if it exisits")
}

@ -0,0 +1,64 @@
package flecmd
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import (
"FLEcli/fleprocess"
"fmt"
"github.com/spf13/cobra"
)
var outputCsvFilename string
var isOverwriteCsv bool
// csvCmd is executed when choosing the csv option (load FLE file and generate csv file)
var csvCmd = &cobra.Command{
Use: "csv [flags] inputFile [outputFile]",
Short: "Generates a SOTA .csv file based on a FLE type shorthand logfile.",
// Long: `A longer description that spans multiple lines and likely contains examples
// and usage of using your command. For example:
RunE: func(cmd *cobra.Command, args []string) error {
//if args is empty, throw an error
if len(args) == 0 {
//TODO: fix this ugly statement (because I am lazy)
return fmt.Errorf("Missing input file %s", "")
}
inputFilename = args[0]
if len(args) == 2 {
outputCsvFilename = args[1]
}
if len(args) > 2 {
return fmt.Errorf("Too many arguments.%s", "")
}
//TODO: should return an error
fleprocess.ProcessCsvCommand(inputFilename, outputCsvFilename, isInterpolateTime, isOverwriteCsv)
return nil
},
}
func init() {
rootCmd.AddCommand(csvCmd)
csvCmd.PersistentFlags().BoolVarP(&isInterpolateTime, "interpolate", "i", false, "Interpolates the missing time entries.")
csvCmd.PersistentFlags().BoolVarP(&isOverwriteCsv, "overwrite", "o", false, "Overwrites the output file if it exisits")
}

@ -0,0 +1,57 @@
package flecmd
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import (
"FLEcli/fleprocess"
"fmt"
"github.com/spf13/cobra"
)
// loadCmd represents the load command
var loadCmd = &cobra.Command{
Use: "load [flags] inputFile",
Short: "Loads and validates a FLE type shorthand logfile",
// Long: `A longer description that spans multiple lines and likely contains examples
// and usage of using your command. For example:
// Cobra is a CLI library for Go that empowers applications.
// This application is a tool to generate the needed files
// to quickly create a Cobra application.`,
RunE: func(cmd *cobra.Command, args []string) error {
//if args is empty, throw an error
if len(args) == 0 {
//TODO: fix this ugly statement (because I am lazy)
return fmt.Errorf("Missing input file %s","")
}
if len(args) > 1 {
return fmt.Errorf("Too many arguments.%s","")
}
inputFilename = args[0]
fleprocess.LoadFile(inputFilename, isInterpolateTime)
return nil
},
}
func init() {
rootCmd.AddCommand(loadCmd)
loadCmd.PersistentFlags().BoolVarP(&isInterpolateTime, "interpolate", "i", false, "Interpolates the missing time entries.")
}

@ -1,4 +1,4 @@
package cmd
package flecmd
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>

@ -1,4 +1,4 @@
package cmd
package flecmd
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
@ -24,8 +24,8 @@ THE SOFTWARE.
import (
"fmt"
"time"
"github.com/spf13/cobra"
"time"
)
var (

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
@ -20,42 +20,16 @@ limitations under the License.
import (
"fmt"
"github.com/spf13/cobra"
)
var outputCsvFilename string
var isOverwriteCsv bool
// csvCmd is executed when choosing the csv option (load FLE file and generate csv file)
var csvCmd = &cobra.Command{
Use: "csv",
Short: "Generates a SOTA .csv file based on a FLE type shorthand logfile.",
// Long: `A longer description that spans multiple lines and likely contains examples
// and usage of using your command. For example:
Run: func(cmd *cobra.Command, args []string) {
processCsvCommand()
},
}
func init() {
rootCmd.AddCommand(csvCmd)
csvCmd.PersistentFlags().StringVarP(&inputFilename, "input", "i", "", "FLE formatted input file (mandatory)")
csvCmd.MarkPersistentFlagRequired("input")
csvCmd.PersistentFlags().BoolVarP(&isInterpolateTime, "interpolate", "", false, "Interpolates the missing time entries.")
csvCmd.PersistentFlags().BoolVarP(&isOverwriteCsv, "overwrite", "", false, "Overwrites the output file if it exisits")
csvCmd.PersistentFlags().StringVarP(&outputCsvFilename, "output", "o", "", "Output filename")
}
func processCsvCommand() {
//ProcessCsvCommand loads an FLE input to produce a SOTA CSV
func ProcessCsvCommand(inputFilename, outputCsvFilename string, isInterpolateTime, isOverwriteCsv bool) {
verifiedOutputFilename, filenameWasOK := buildOutputFilename(outputCsvFilename, inputFilename, isOverwriteCsv, ".csv")
// if the output file could not be parsed correctly do noting
if filenameWasOK {
loadedLogFile, isLoadedOK := loadFile()
loadedLogFile, isLoadedOK := LoadFile(inputFilename, isInterpolateTime)
//TODO: move this in a function so that it can be more easily tested
if isLoadedOK {

@ -0,0 +1,60 @@
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import (
"fmt"
)
//ProcessAdifCommand FIXME
func ProcessAdifCommand(inputFilename, outputFilename string, isInterpolateTime, isWWFFcli, isSOTAcli, isOverwrite bool) {
verifiedOutputFilename, filenameWasOK := buildOutputFilename(outputFilename, inputFilename, isOverwrite, ".adi")
// if the output file could not be parsed correctly do noting
if filenameWasOK {
loadedLogFile, isLoadedOK := LoadFile(inputFilename,isInterpolateTime)
if isLoadedOK {
if len(loadedLogFile) == 0 {
fmt.Println("No useful data read. Aborting...")
return
}
//TODO: There are more tests required here
//check if we have the necessary information for the type
if isWWFFcli {
if loadedLogFile[0].MyWWFF == "" {
fmt.Println("Missing MY-WWFF reference. Aborting...")
return
}
if loadedLogFile[0].Operator == "" {
fmt.Println("Missing Operator. Aborting...")
return
}
}
if isSOTAcli {
if loadedLogFile[0].MySOTA == "" {
fmt.Println("Missing MY-SOTA reference. Aborting...")
return
}
}
OutputAdif(verifiedOutputFilename, loadedLogFile, isWWFFcli, isSOTAcli)
}
}
}

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
@ -24,8 +24,8 @@ import (
"time"
)
// outputAdif generates and writes data in ADIF format
func outputAdif(outputFile string, fullLog []LogLine, isWWFF bool, isSOTA bool) {
// OutputAdif generates and writes data in ADIF format
func OutputAdif(outputFile string, fullLog []LogLine, isWWFF bool, isSOTA bool) {
//convert the log data to an in-memory ADIF file
adifData := buildAdif(fullLog, isWWFF, isSOTA)

@ -1,4 +1,4 @@
package cmd
package fleprocess
import (
"reflect"

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>

@ -1,4 +1,4 @@
package cmd
package fleprocess
import "testing"

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
@ -48,8 +48,8 @@ func buildCsv(fullLog []LogLine) (csvList []string) {
csvLine.WriteString(fmt.Sprintf(",%s", logLine.Time))
//TODO: Should we test the result
_, _, _, sotaBand := IsBand(logLine.Band)
csvLine.WriteString(fmt.Sprintf(",%s",sotaBand ))
csvLine.WriteString(fmt.Sprintf(",%s",logLine.Mode))
csvLine.WriteString(fmt.Sprintf(",%s", sotaBand))
csvLine.WriteString(fmt.Sprintf(",%s", logLine.Mode))
csvLine.WriteString(fmt.Sprintf(",%s", logLine.Call))
if logLine.SOTA != "" {
csvLine.WriteString(fmt.Sprintf(",%s", logLine.SOTA))
@ -67,7 +67,6 @@ func buildCsv(fullLog []LogLine) (csvList []string) {
return csvList
}
//adifDate converts a date in YYYY-MM-DD format to YYYYMMDD
func csvDate(inputDate string) (outputDate string) {
const FLEdateFormat = "2006-01-02"

@ -1,4 +1,4 @@
package cmd
package fleprocess
import (
"reflect"

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>

@ -1,4 +1,4 @@
package cmd
package fleprocess
import (
"errors"

@ -1,4 +1,4 @@
package cmd
package fleprocess
import (
"fmt"

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
@ -23,53 +23,11 @@ import (
"os"
"regexp"
"time"
//"time"
"github.com/spf13/cobra"
//"strings"
)
// loadCmd represents the load command
var loadCmd = &cobra.Command{
Use: "load",
Short: "Loads and validates a FLE type shorthand logfile",
// Long: `A longer description that spans multiple lines and likely contains examples
// and usage of using your command. For example:
// Cobra is a CLI library for Go that empowers applications.
// This application is a tool to generate the needed files
// to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
//fmt.Println("load called")
//fmt.Println("Inputfile: ",inputFilename)
loadFile()
},
}
func init() {
rootCmd.AddCommand(loadCmd)
loadCmd.PersistentFlags().StringVarP(&inputFilename, "input", "i", "", "FLE formatted input file (mandatory)")
loadCmd.MarkPersistentFlagRequired("input")
loadCmd.PersistentFlags().BoolVarP(&isInterpolateTime, "interpolate", "", false, "Interpolates the missing time entries.")
// rootCmd.PersistentFlags().StringVarP(&inputFilename, "input", "i", "", "FLE formatted input file (mandatory)")
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// loadCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// loadCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
//LoadFile FIXME
//returns nill if failure to process
func loadFile() (filleFullLog []LogLine, isProcessedOK bool) {
func LoadFile(inputFilename string, isInterpolateTime bool) (filleFullLog []LogLine, isProcessedOK bool) {
file, err := os.Open(inputFilename)
if err != nil {

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>
@ -17,16 +17,12 @@ limitations under the License.
*/
import (
"os"
"fmt"
"os"
"path/filepath"
)
// does the target file exist?
// is the file defined
// remove the extention
//returning "" is considered as invalid
//buildOutputFilname will try to figure out an output filename (for the case none was provided)
func buildOutputFilename(output string, input string, overwrite bool, newExtension string) (outputFilename string, wasOK bool) {
outputFilename = ""

@ -1,4 +1,4 @@
package cmd
package fleprocess
import (
"os"

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>

@ -1,4 +1,4 @@
package cmd
package fleprocess
import (
"reflect"

@ -1,4 +1,4 @@
package cmd
package fleprocess
/*
Copyright © 2020 Jean-Marc Meessen, ON4KJM <on4kjm@gmail.com>

@ -1,4 +1,4 @@
package cmd
package fleprocess
import (
"testing"
@ -276,8 +276,6 @@ func TestValidateDate(t *testing.T) {
}
}
func TestIsBand(t *testing.T) {
type args struct {
inputStr string
@ -303,7 +301,7 @@ func TestIsBand(t *testing.T) {
{
"valid band but uppercase",
args{inputStr: "40M"},
true, 7.0, 7.3,"7MHz",
true, 7.0, 7.3, "7MHz",
},
}
for _, tt := range tests {

@ -21,8 +21,10 @@ THE SOFTWARE.
*/
package main
import "FLEcli/cmd"
//import "github.com/spf13/cobra/cobra/cmd"
import "FLEcli/flecmd"
func main() {
cmd.Execute()
flecmd.Execute()
}

@ -0,0 +1,40 @@
#!/bin/bash
echo "# Usage" > help.txt
echo " " >> help.txt
echo " " >> help.txt
echo "## Overview" >> help.txt
echo "\`\`\`" >> help.txt
../dist/FLEcli_darwin_amd64/FLEcli >> help.txt
echo "\`\`\`" >> help.txt
echo " " >> help.txt
echo " " >> help.txt
echo "## \"LOAD\" command" >> help.txt
echo "\`\`\`" >> help.txt
../dist/FLEcli_darwin_amd64/FLEcli load --help >> help.txt
echo "\`\`\`" >> help.txt
echo " " >> help.txt
echo " " >> help.txt
echo "## \"ADIF\" command" >> help.txt
echo "\`\`\`" >> help.txt
../dist/FLEcli_darwin_amd64/FLEcli adif --help >> help.txt
echo "\`\`\`" >> help.txt
echo " " >> help.txt
echo " " >> help.txt
echo "## \"CSV\" command" >> help.txt
echo "\`\`\`" >> help.txt
../dist/FLEcli_darwin_amd64/FLEcli csv --help >> help.txt
echo "\`\`\`" >> help.txt
echo " " >> help.txt
echo " " >> help.txt
echo "## \"VERSION\" command" >> help.txt
echo "\`\`\`" >> help.txt
../dist/FLEcli_darwin_amd64/FLEcli version --help >> help.txt
echo "\`\`\`" >> help.txt
echo "The normal output looks like \`FLEcli version: v0.1.2\`. The detailled output gives additionaly the Git commit hash. the date and time of build and who built the release." >> help.txt
Loading…
Cancel
Save