Merge branch 'trunk' into mm-codespaces-remove-friendly-machine-name

This commit is contained in:
Mike McDonald 2021-10-18 10:35:48 -06:00 committed by GitHub
commit e923eb8853
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 12 deletions

2
go.mod
View file

@ -11,7 +11,7 @@ require (
github.com/cli/oauth v0.8.0
github.com/cli/safeexec v1.0.0
github.com/cpuguy83/go-md2man/v2 v2.0.1
github.com/creack/pty v1.1.16
github.com/creack/pty v1.1.17
github.com/gabriel-vasile/mimetype v1.4.0
github.com/google/go-cmp v0.5.6
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510

4
go.sum
View file

@ -90,8 +90,8 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.16 h1:vfetlOf3A+9YKggibynnX9mnFjuSVvkRj+IWpcTSLEQ=
github.com/creack/pty v1.1.16/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ=
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View file

@ -155,8 +155,8 @@ type CodespaceGitStatus struct {
Ahead int `json:"ahead"`
Behind int `json:"behind"`
Ref string `json:"ref"`
HasUnpushedChanges bool `json:"hasUnpushedChanges"`
HasUncommitedChanges bool `json:"hasUncommitedChanges"`
HasUnpushedChanges bool `json:"has_unpushed_changes"`
HasUncommitedChanges bool `json:"has_uncommited_changes"`
}
const (

View file

@ -1,21 +1,23 @@
package codespace
import (
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
)
var version = "DEV" // Replaced in the release build process (by GoReleaser or Homebrew) by the git tag version number.
func NewRootCmd(app *App) *cobra.Command {
root := &cobra.Command{
Use: "codespace",
SilenceUsage: true, // don't print usage message after each error (see #80)
SilenceErrors: false, // print errors automatically so that main need not
Long: `Unofficial CLI tool to manage GitHub Codespaces.
Running commands requires the GITHUB_TOKEN environment variable to be set to a
token to access the GitHub API with.`,
Version: version,
Short: "List, create, delete and SSH into codespaces",
Long: `Work with GitHub codespaces`,
Example: heredoc.Doc(`
$ gh codespace list
$ gh codespace create
$ gh codespace delete
$ gh codespace ssh
`),
}
root.AddCommand(newCodeCmd(app))