Skip to content

Commit

Permalink
Add output to README and give shorthand flag for config
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Scott committed May 31, 2018
1 parent 2f78690 commit 98b96fe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,19 @@ $ make

```
$ ./build/target/linux/amd64/cli diagnostic
# some output
Please enter your CircleCI API token:
OK.
Your configuration has been created in `/home/zzak/.circleci/cli.yml`.
It can edited manually for advanced settings.
---
CircleCI CLI Diagnostics
---
Config found: `/home/zzak/.circleci/cli.yml`
Host is: https://circleci.com
OK, got a token.
```

## Known Issues
Expand Down
2 changes: 1 addition & 1 deletion cmd/diagnostic.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func diagnostic(cmd *cobra.Command, args []string) {
host := viper.GetString("host")
token := viper.GetString("token")

fmt.Printf("---\nCircleCI CLI Diagnostics\n---\n")
fmt.Printf("\n---\nCircleCI CLI Diagnostics\n---\n\n")
fmt.Printf("Config found: `%v`\n", viper.ConfigFileUsed())

if host == "host" || host == "" {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func Execute() {
func init() {
cobra.OnInitialize(initConfig)

RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.circleci/cli.yml)")
RootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file (default is $HOME/.circleci/cli.yml)")
RootCmd.PersistentFlags().StringP("host", "H", "https://circleci.com", "the host of your CircleCI install")
RootCmd.PersistentFlags().StringP("token", "t", "", "your token for using CircleCI")

Expand Down

0 comments on commit 98b96fe

Please sign in to comment.