all:
- @echo "Options are: build and buildall"
+ @echo "Options are: build scientia-cli scientia-cli-linux-amd64 scientia-cli-windows-amd64 scientia-cli-darwin-amd64 clean buildall"
-build:
+scientia-cli:
@echo "Building for local os/arch..."
- go build -o scientia-cli-`go env GOOS`-`go env GOARCH`
+ go build -o scientia-cli
-buildall:
+scientia-cli-linux-amd64:
@echo "Building for linux/amd64 arch..."
GOOS=linux GOARCH=amd64 go build -o scientia-cli-linux-amd64
- @echo "Done: scientia-cli-linux-amd64"
+
+scientia-cli-windows-amd64:
@echo "Building for windows/amd64 arch..."
GOOS=windows GOARCH=amd64 go build -o scientia-cli-windows-amd64
- @echo "Done: scientia-cli-windows-amd64"
+
+scientia-cli-darwin-amd64:
@echo "Building for macOS/amd64 arch..."
GOOS=darwin GOARCH=amd64 go build -o scientia-cli-darwin-amd64
- @echo "Done: scientia-cli-darwin-amd64"
\ No newline at end of file
+
+build:
+ @echo "Building for local os/arch..."
+ go build -o scientia-cli-`go env GOOS`-`go env GOARCH`
+
+buildall: scientia-cli-linux-amd64 scientia-cli-windows-amd64 scientia-cli-darwin-amd64
+ @echo "Building for linux/amd64, windows/amd64 and macOS/amd64 arch..."
+
+clean:
+ rm -f scientia-cli scientia-cli-darwin-amd64 scientia-cli-windows-amd64 scientia-cli-linux-amd64
\ No newline at end of file
+++ /dev/null
-This is a terminal cli client written in go to be used with scientia
-https://://www.bananas-playground.net/projekt/scientia
-
-!WARNING!
-This is a very simple, with limited experience written, go program.
-Use at own risk and feel free to improve.
-
-# Howto build
-Nothing special, just use the provide Makefile or directly "go build -o scientia-cli" to use your current os/arch settings.
-
-# Usage
-At first usage you need to create the config and the individual secret.
-Run $scientia-cli -create-config-file to create the default config file.
-The path to the config file is printed.
-Change the host address and update your server it with the secret, which is randomly created.
-
-Read from a file
-$ scientia-cli file.txt
-or piped
-$ cat file.txt | scientia-cli
-
-Commandline arguments (optional):
- -create-config-file
- Create default config file
- -debug
- Print debug infos
- -verbose
- Produce verbose output
--- /dev/null
+# scienta go cli client
+
+This is a terminal cli client written in go to be used with scientia
+https://://www.bananas-playground.net/projekt/scientia/
+
+!WARNING!
+This is a very simple, with limited experience written, go program.
+Use at own risk and feel free to improve.
+
+# Howto build
+
+Nothing special, just use the provided Makefile or directly
+"go build -o scientia-cli" to use your current os/arch settings.
+
+# Usage
+
+At first usage you need to create the config and the individual secret.
+Run $scientia-cli -create-config-file to create the default config file.
+The path to the config file is printed.
+Change the host address and update your server it with the secret, which is randomly created.
+
+## Create
+
+Read from a file `$ scientia-cli file.txt` or piped `$ cat file.txt | scientia-cli`
+
+# Commandline arguments
+
+## Optinal
+
++ `-create-config-file` Create default config file
++ `-debug` Print debug infos
++ `-verbose` Produce verbose output
"errors"
"flag"
"fmt"
- "gopkg.in/yaml.v2"
"io"
"log"
"math/rand"
"net/http"
"os"
+
+ "gopkg.in/yaml.v2"
)
/**
* along with this program. If not, see http://www.sun.com/cddl/cddl.html
*/
-const website = "https://www.bananas-playground.net/projekt/scientia"
+const website = "https://www.bananas-playground.net/projekt/scientia/"
const version = "1.0"
// used for non-existing default config
*/
func main() {
+ // https://cli.urfave.org/v2/examples/arguments/
+ // https://github.com/dnote/dnote
+ //https://github.com/spf13/cobra/blob/main/site/content/user_guide.md
+
// parse commandline parameters
flag.BoolVar(&optsVerbose, "verbose", false, "Produce verbose output")
flag.BoolVar(&optsCreateConfig, "create-config-file", false, "Create default config file")