From 9c5930bd5707d8471584636a68bf1e1c71f4de5e Mon Sep 17 00:00:00 2001 From: Sylvia Moss Date: Wed, 5 Feb 2020 10:28:30 +0100 Subject: [PATCH] Improve usage and readme content --- Makefile | 17 ++++++----------- README.md | 28 +++++++++++++++++++++------- cmd/root.go | 4 ++-- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 7defb710..bf3f1304 100644 --- a/Makefile +++ b/Makefile @@ -4,16 +4,11 @@ build: @go build -o ~/go/bin/diceware . build_windows: - @GOOS=windows go build -o ./pkg/diceware . \ - && zip ./pkg/diceware_windows_$(GOARCH).zip ./pkg/diceware \ - && rm ./pkg/diceware + @env GOOS=windows go build . \ + && zip ./pkg/diceware_windows_$(GOARCH).zip diceware-cli.exe \ + && rm diceware-cli.exe build_linux: - @GOOS=linux go build -o ./pkg/diceware . \ - && zip ./pkg/diceware_linux_$(GOARCH).zip ./pkg/diceware \ - && rm ./pkg/diceware - -build_macOS: - @go build -o ./pkg/diceware . \ - && zip ./pkg/diceware_macOS_$(GOARCH).zip ./pkg/diceware \ - && rm ./pkg/diceware \ No newline at end of file + @env GOOS=linux go build . \ + && zip ./pkg/diceware_linux_$(GOARCH).zip diceware-cli \ + && rm diceware-cli diff --git a/README.md b/README.md index 36c7d551..7f58db9c 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,26 @@ A tool that generates strong passwords based on easily memorable words that are ## Usage ``` -diceware generate [flags] +Usage: + diceware generate [flags] Flags: - -c, --copy pbcopy password - -h, --help help for generate - --hide pbcopy and hide password. Password WON'T be printed out - -l, --lang string password language (default "en") - -s, --size int32 the amount words the password will have (default 6) -``` \ No newline at end of file + -c, --copy pbcopy password + -h, --help help for generate + --hide pbcopy and hide password. Password WON'T be printed out + -l, --lang string password language + available langs: en, pt (default "en") + --separator string character that separates the words, + to remove reparator use --separator=none (default " ") + -s, --size int32 the amount words the password will have (default 6) +``` + +## Installation Guide + +Unzip the zip files to find the binaries inside the `pkg` folder. + +On Unix systems, place the binaries in your favorite folder, but to access it from the command-line, you will need to add the folder path somewhere on your **PATH** variable. + +See [this page](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix) for instructions on setting the **PATH** on Linux and Mac. [This page](https://stackoverflow.com/questions/1618280/where-can-i-set-path-to-make-exe-on-windows) contains instructions for setting the **PATH** on Windows. + +If you face some difficulty during the installation, please let me know by reporting an issue in this repository. \ No newline at end of file diff --git a/cmd/root.go b/cmd/root.go index 38d41a0f..978dab7b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -18,8 +18,8 @@ var rootCmd = &cobra.Command{ } func Execute() { - generateCmd.Flags().StringVarP(&generateConfig.Lang, "lang", "l", "en", "password language") - generateCmd.Flags().StringVar(&generateConfig.Separator, "separator", " ", "character that separates the words") + generateCmd.Flags().StringVarP(&generateConfig.Lang, "lang", "l", "en", "password language\n available langs: en, pt") + generateCmd.Flags().StringVar(&generateConfig.Separator, "separator", " ", "character that separates the words,\n to remove reparator use --separator=none") generateCmd.Flags().Int32VarP(&generateConfig.Size, "size", "s", 6, "the amount words the password will have") generateCmd.Flags().BoolVarP(&generateConfig.Pbcopy, "copy", "c", false, "pbcopy password") generateCmd.Flags().BoolVar(&generateConfig.Hide, "hide", false, "pbcopy and hide password. Password WON'T be printed out")