-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): show proper usage message on errors
* Show proper sub-commands usage text instead of the root usage when errors occur * Store CLI arguments in objects, to avoid accidentally referring to them within the packages * Extract repeated code for app identifier arguments * Move logic for refreshing access tokens to the `auth` package * Move logic for validating app identifiers into the `appident` package * Move organization creation wizard logic into the `cmd/organization/create` package to simplify * Split several commands logic, so that `cmd.go` contains the actual command definition
- Loading branch information
Showing
37 changed files
with
544 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package args | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
) | ||
|
||
type AppIdentifierArg struct { | ||
OrganizationSlug string | ||
AppSlug string | ||
} | ||
|
||
func (a *AppIdentifierArg) AddAppIdentifierFlags(flags *pflag.FlagSet, action string) { | ||
AddOrganizationSlugFlag(flags, action, &a.OrganizationSlug) | ||
flags.StringVarP(&a.AppSlug, "app", "a", "", "An app slug identifier of the app "+action+".") | ||
} | ||
|
||
func AddOrganizationSlugFlag(flags *pflag.FlagSet, action string, orgSlug *string) { | ||
flags.StringVarP(orgSlug, "organization", "o", "", "The organization slug identifier of the app "+action+". List available organizations with 'numerous organization list'.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.