Skip to content

Commit

Permalink
CLI stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ethndotsh committed Aug 12, 2023
1 parent 64ca698 commit 7b60440
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions cli/cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ import (
var LoginCommand = cli.Command{
Name: "login",
Aliases: []string{"auth", "signin"},
Usage: "Login to your OpenBin account.",
Usage: "Login to your Openbin account.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "email",
Aliases: []string{"e"},
Usage: "Your OpenBin account email.",
Usage: "Your Openbin account email.",
Required: false,
},
&cli.StringFlag{
Name: "provider",
Aliases: []string{"p"},
Usage: "Your OpenBin account provider.",
Usage: "Your Openbin account provider.",
Required: false,
DefaultText: "github",
},
Expand Down Expand Up @@ -78,8 +78,8 @@ var LoginCommand = cli.Command{
http.HandleFunc("/auth-callback", func(w http.ResponseWriter, r *http.Request) {
// get the code
code := r.URL.Query().Get("code")
fmt.Printf("Code: %s\n", code)
fmt.Printf("Code verifier: %s\n", codeVerifier)
// fmt.Printf("Code: %s\n", code)
// fmt.Printf("Code verifier: %s\n", codeVerifier)
// get the token
token, err := supabase.Auth.ExchangeCode(ctx, sb.ExchangeCodeOpts{
AuthCode: code,
Expand Down Expand Up @@ -126,7 +126,7 @@ var LoginCommand = cli.Command{
var LogoutCommand = cli.Command{
Name: "logout",
Aliases: []string{"signout"},
Usage: "Logout from your OpenBin account.",
Usage: "Logout from your Openbin account.",
Action: func(cCtx *cli.Context) error {
settings.SetAccessToken("")
settings.SetRefreshToken("")
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var DeleteCommand = cli.Command{
user, err := supabase.Auth.User(ctx, settings.AccessToken)

if err != nil {
cli.Exit("Could not get the user. Try signing in with `openbin login`.", 1)
cli.Exit("You don't seem to be signed in. Try running `openbin login` to sign in.", 1)
return err
}

Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/pastes.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ var PastesCommand = cli.Command{
user, err := supabase.Auth.User(ctx, settings.AccessToken)

if err != nil {
cli.Exit("Could not get the user. Try signing in with `openbin login`.", 1)
cli.Exit("You don't seem to be signed in. Try running `openbin login` to sign in.", 1)
}

if user == nil {
cli.Exit("Could not get the user. Try signing in with `openbin login`.", 1)
cli.Exit("You don't seem to be signed in. Try running `openbin login` to sign in.", 1)
}

supabase.DB.AddHeader("Authorization", fmt.Sprintf("Bearer %s", settings.AccessToken))
Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ type UploadOptions struct {

var UploadCommand = cli.Command{
Name: "upload",
Aliases: []string{"u"},
Usage: "Upload a file to OpenBin.",
Aliases: []string{"u", "up"},
Usage: "Upload a file to Openbin.",
ArgsUsage: "[FILE]",
Flags: []cli.Flag{
&cli.StringFlag{
Expand Down Expand Up @@ -226,7 +226,7 @@ func UploadFile(path string, opts UploadOptions) {
user, err := supabase.Auth.User(ctx, settings.AccessToken)

if err != nil {
cli.Exit("Could not get the user. Try signing in with `openbin login`.", 1)
cli.Exit("You don't seem to be signed in. Try running `openbin login` to sign in.", 1)
}

supabase.DB.AddHeader("Authorization", fmt.Sprintf("Bearer %s", settings.AccessToken))
Expand Down
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Run() {
Name: "openbin",
HelpName: "openbin",
EnableBashCompletion: true,
Description: "A CLI tool for OpenBin, a free and open-source pastebin alternative.",
Description: "A CLI tool for Openbin, a free and open-source pastebin alternative built primarily for command-line warriors.",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "version",
Expand Down

0 comments on commit 7b60440

Please sign in to comment.