Skip to content

Commit

Permalink
Merge pull request #10 from sassoftware/minor-stuff
Browse files Browse the repository at this point in the history
-add .gitignore
  • Loading branch information
sarahcpage authored Jun 29, 2021
2 parents 76cdc59 + 585dc3a commit e4f617f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
.vscode
.idea
viya4-orders-cli_windows_amd64.exe
viya4-orders-cli_linux_amd64
viya4-orders-cli_darwin_amd64
main
main.exe
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ darwin: $(DARWIN) ## Build for Darwin (Mac OS)
$(WINDOWS):
@echo version: $(VERSION)
env GOOS=windows GOARCH=amd64 go build -o $(WINDOWS) -ldflags="$(BUILDARGS)" $(MAIN)

$(LINUX):
@echo version: $(VERSION)
env GOOS=linux GOARCH=amd64 go build -o $(LINUX) -ldflags="$(BUILDARGS)" $(MAIN)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Flags:
-c, --config string config file (default is $HOME/.viya4-orders-cli)
-n, --file-name string name of the file where you want the downloaded order asset to be stored
(defaults:
certs - SASiyaV4_<order number>_certs.zip
license and depassets - SASiyaV4_<order number>_<renewal sequence>_<cadence information>_<asset name>_<date time stamp>.<asset extension>
certs - SASViyaV4_<order number>_certs.zip
license and depassets - SASViyaV4_<order number>_<renewal sequence>_<cadence information>_<asset name>_<date time stamp>.<asset extension>
)
-p, --file-path string path to where you want the downloaded order asset stored (default is path to your current working directory)
-h, --help help for viya4-orders-cli
Expand Down
10 changes: 6 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func init() {
"config file (default is $HOME/.viya4-orders-cli)")
rootCmd.PersistentFlags().StringVarP(&assetFileName, "file-name", "n", "",
"name of the file where you want the downloaded order asset stored\n"+
"(defaults:\n\tcerts - SASiyaV4_<order number>_certs.zip\n\tlicense and depassets - SASiyaV4_<order number>_<renewal sequence>_<cadence information>_<asset name>_<date time stamp>."+
"(defaults:\n\tcerts - SASViyaV4_<order number>_certs.zip\n\tlicense and depassets - SASViyaV4_<order number>_<renewal sequence>_<cadence information>_<asset name>_<date time stamp>."+
"<asset extension>\n)")
rootCmd.PersistentFlags().StringVarP(&assetFilePath, "file-path", "p", "",
"path to where you want the downloaded order asset stored (default is path to your current working directory)")
Expand Down Expand Up @@ -130,13 +130,15 @@ func setOptions() {
}
}

// usageError prints the given error followed by the help text.
// usageError prints the given error followed by the tool usage text, and then exits.
// Essentially, this mimics what Cobra does when it detects a usage error.
func usageError(message string) {
println("Error: " + message)
err := rootCmd.Help()
err := rootCmd.Usage()
if err != nil {
log.Fatalln("ERROR: rootCmd.Help() returned " + err.Error())
log.Fatalln("ERROR: rootCmd.Usage() returned " + err.Error())
}
os.Exit(0)
}

// auth gets the Bearer token.
Expand Down

0 comments on commit e4f617f

Please sign in to comment.