From 62fcd9c216efb49b48af70cb959a28eb17f52b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Meireles?= Date: Tue, 5 Jan 2016 11:23:18 +0000 Subject: [PATCH] update Godeps' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: António Meireles --- Godeps/Godeps.json | 40 +- .../src/github.com/BurntSushi/toml/lex.go | 2 - .../cpuguy83/go-md2man/md2man/roff.go | 28 +- .../go-github/github/activity_watching.go | 7 +- .../github/activity_watching_test.go | 11 +- .../github.com/google/go-github/github/doc.go | 2 +- .../google/go-github/github/github.go | 85 +++- .../google/go-github/github/github_test.go | 91 ++++- .../google/go-github/github/issues.go | 4 +- .../google/go-github/github/orgs_members.go | 2 +- .../google/go-github/github/repos.go | 25 +- .../google/go-github/github/repos_hooks.go | 1 + .../google/go-github/github/repos_test.go | 16 +- .../src/github.com/pkg/sftp/.travis.yml | 2 + .../src/github.com/pkg/sftp/client.go | 64 +-- .../sftp/client_integration_darwin_test.go | 3 + .../pkg/sftp/client_integration_linux_test.go | 3 + .../pkg/sftp/client_integration_test.go | 43 ++- .../src/github.com/pkg/sftp/client_test.go | 77 ++-- .../src/github.com/pkg/sftp/server.go | 364 ++++++++++-------- .../github.com/russross/blackfriday/block.go | 10 +- .../russross/blackfriday/block_test.go | 51 +++ .../spf13/cobra/bash_completions.go | 4 +- .../thatswhyyoualwaysleaveanote.go | 26 +- .../src/github.com/spf13/viper/viper.go | 11 +- .../src/github.com/spf13/viper/viper_test.go | 5 +- documentation/man/corectl-kill.1 | 4 +- documentation/man/corectl-load.1 | 4 +- documentation/man/corectl-ls.1 | 4 +- documentation/man/corectl-ps.1 | 4 +- documentation/man/corectl-pull.1 | 4 +- documentation/man/corectl-put.1 | 4 +- documentation/man/corectl-query.1 | 4 +- documentation/man/corectl-rm.1 | 4 +- documentation/man/corectl-run.1 | 4 +- documentation/man/corectl-ssh.1 | 4 +- documentation/man/corectl-version.1 | 4 +- documentation/man/corectl.1 | 4 +- 38 files changed, 703 insertions(+), 322 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index d281a4b..a1a9e46 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -7,8 +7,18 @@ "Deps": [ { "ImportPath": "github.com/BurntSushi/toml", - "Comment": "v0.1.0-21-g056c9bc", - "Rev": "056c9bc7be7190eaa7715723883caffa5f8fa3e4" + "Comment": "v0.1.0-23-g5c4df71", + "Rev": "5c4df71dfe9ac89ef6287afc05e4c1b16ae65a1e" + }, + { + "ImportPath": "github.com/TheNewNormal/corectl/image", + "Comment": "v0.0.20-5-g91ea1cf", + "Rev": "91ea1cf4155c5670a1c5a23bf21445b392fd7f6b" + }, + { + "ImportPath": "github.com/TheNewNormal/corectl/uuid2ip", + "Comment": "v0.0.20-5-g91ea1cf", + "Rev": "91ea1cf4155c5670a1c5a23bf21445b392fd7f6b" }, { "ImportPath": "github.com/TheNewNormal/libxhyve", @@ -21,8 +31,8 @@ }, { "ImportPath": "github.com/cpuguy83/go-md2man/md2man", - "Comment": "v1.0.4", - "Rev": "71acacd42f85e5e82f70a55327789582a5200a90" + "Comment": "v1.0.4-2-g2724a9c", + "Rev": "2724a9c9051aa62e9cca11304e7dd518e9e41599" }, { "ImportPath": "github.com/deoxxa/gocpio", @@ -31,7 +41,7 @@ }, { "ImportPath": "github.com/google/go-github/github", - "Rev": "44b1ede22d71e26fa5d7af7a50204f7e6daadfc8" + "Rev": "63fbbb283ce4913a5ac1b6de7abae50dbf594a04" }, { "ImportPath": "github.com/google/go-querystring/query", @@ -65,7 +75,7 @@ }, { "ImportPath": "github.com/pkg/sftp", - "Rev": "4f25752b7ac0c524bfb6f780435f29cfd5b6c9e3" + "Rev": "9e66bf3ae26ff73a0dd2557c891853f3f3a59a7b" }, { "ImportPath": "github.com/rakyll/pb", @@ -73,8 +83,8 @@ }, { "ImportPath": "github.com/russross/blackfriday", - "Comment": "v1.4-17-gb803157", - "Rev": "b8031576aa454ce8a52a7faf1a4359a72f8bdf95" + "Comment": "v1.4-19-gc8875c0", + "Rev": "c8875c0ed47e07b063c3628e2e4d4c9826721795" }, { "ImportPath": "github.com/satori/go.uuid", @@ -90,11 +100,11 @@ }, { "ImportPath": "github.com/spf13/cobra", - "Rev": "b3f29e98e63a3618988a231fd02b45c1e6369d4f" + "Rev": "c6399cd398905db8208d06e30525513f53aaca98" }, { "ImportPath": "github.com/spf13/jwalterweatherman", - "Rev": "c2aa07df593850a04644d77bb757d002e517a296" + "Rev": "d00654080cddbd2b082acaa74007cb94a2b40866" }, { "ImportPath": "github.com/spf13/pflag", @@ -102,7 +112,7 @@ }, { "ImportPath": "github.com/spf13/viper", - "Rev": "110492b3001269a0777997fcbe68a60828fac4cb" + "Rev": "0c82789feb03da74b3390a5d64b8ce2ce9ba0f3e" }, { "ImportPath": "github.com/yeonsh/go-ps", @@ -110,19 +120,19 @@ }, { "ImportPath": "golang.org/x/crypto/cast5", - "Rev": "f18420efc3b4f8e9f3d51f6bd2476e92c46260e9" + "Rev": "552e9d568fde9701ea1944fb01c8aadaceaa7353" }, { "ImportPath": "golang.org/x/crypto/curve25519", - "Rev": "f18420efc3b4f8e9f3d51f6bd2476e92c46260e9" + "Rev": "552e9d568fde9701ea1944fb01c8aadaceaa7353" }, { "ImportPath": "golang.org/x/crypto/openpgp", - "Rev": "f18420efc3b4f8e9f3d51f6bd2476e92c46260e9" + "Rev": "552e9d568fde9701ea1944fb01c8aadaceaa7353" }, { "ImportPath": "golang.org/x/crypto/ssh", - "Rev": "f18420efc3b4f8e9f3d51f6bd2476e92c46260e9" + "Rev": "552e9d568fde9701ea1944fb01c8aadaceaa7353" }, { "ImportPath": "gopkg.in/fsnotify.v1", diff --git a/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go b/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go index 2191228..08dce77 100644 --- a/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go +++ b/Godeps/_workspace/src/github.com/BurntSushi/toml/lex.go @@ -272,8 +272,6 @@ func lexTableNameStart(lx *lexer) stateFn { lx.ignore() lx.push(lexTableNameEnd) return lexValue // reuse string lexing - case isWhitespace(r): - return lexTableNameStart default: return lexBareTableName } diff --git a/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/md2man/roff.go b/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/md2man/roff.go index 4478786..9f12daa 100644 --- a/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/md2man/roff.go +++ b/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/md2man/roff.go @@ -11,6 +11,8 @@ import ( type roffRenderer struct{} +var listCounter int + func RoffRenderer(flags int) blackfriday.Renderer { return &roffRenderer{} } @@ -33,8 +35,12 @@ func (r *roffRenderer) TitleBlock(out *bytes.Buffer, text []byte) { line = append(line, []byte("\" ")...) out.Write(line) } + out.WriteString("\n") - out.WriteString(" \"\"\n") + // disable hyphenation + out.WriteString(".nh\n") + // disable justification (adjust text to left margin only) + out.WriteString(".ad l\n") } func (r *roffRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) { @@ -80,23 +86,24 @@ func (r *roffRenderer) HRule(out *bytes.Buffer) { func (r *roffRenderer) List(out *bytes.Buffer, text func() bool, flags int) { marker := out.Len() - out.WriteString(".IP ") if flags&blackfriday.LIST_TYPE_ORDERED != 0 { - out.WriteString("\\(bu 2") - } else { - out.WriteString("\\n+[step" + string(flags) + "]") + listCounter = 1 } - out.WriteString("\n") if !text() { out.Truncate(marker) return } - } func (r *roffRenderer) ListItem(out *bytes.Buffer, text []byte, flags int) { - out.WriteString("\n\\item ") + if flags&blackfriday.LIST_TYPE_ORDERED != 0 { + out.WriteString(fmt.Sprintf(".IP \"%3d.\" 5\n", listCounter)) + listCounter += 1 + } else { + out.WriteString(".IP \\(bu 2\n") + } out.Write(text) + out.WriteString("\n") } func (r *roffRenderer) Paragraph(out *bytes.Buffer, text func() bool) { @@ -249,6 +256,11 @@ func needsBackslash(c byte) bool { func escapeSpecialChars(out *bytes.Buffer, text []byte) { for i := 0; i < len(text); i++ { + // escape initial apostrophe or period + if len(text) >= 1 && (text[0] == '\'' || text[0] == '.') { + out.WriteString("\\&") + } + // directly copy normal characters org := i diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching.go b/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching.go index 150cf66..c002b3b 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching.go @@ -50,13 +50,18 @@ func (s *ActivityService) ListWatchers(owner, repo string, opt *ListOptions) ([] // the empty string will fetch watched repos for the authenticated user. // // GitHub API Docs: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched -func (s *ActivityService) ListWatched(user string) ([]Repository, *Response, error) { +func (s *ActivityService) ListWatched(user string, opt *ListOptions) ([]Repository, *Response, error) { var u string if user != "" { u = fmt.Sprintf("users/%v/subscriptions", user) } else { u = "user/subscriptions" } + u, err := addOptions(u, opt) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching_test.go b/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching_test.go index 8046ee2..a8a4a46 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching_test.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/activity_watching_test.go @@ -43,10 +43,13 @@ func TestActivityService_ListWatched_authenticatedUser(t *testing.T) { mux.HandleFunc("/user/subscriptions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "2", + }) fmt.Fprint(w, `[{"id":1}]`) }) - watched, _, err := client.Activity.ListWatched("") + watched, _, err := client.Activity.ListWatched("", &ListOptions{Page: 2}) if err != nil { t.Errorf("Activity.ListWatched returned error: %v", err) } @@ -63,10 +66,14 @@ func TestActivityService_ListWatched_specifiedUser(t *testing.T) { mux.HandleFunc("/users/u/subscriptions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") + testFormValues(t, r, values{ + "page": "2", + }) fmt.Fprint(w, `[{"id":1}]`) }) - watched, _, err := client.Activity.ListWatched("u") + watched, _, err := client.Activity.ListWatched("u", &ListOptions{Page: 2}) + if err != nil { t.Errorf("Activity.ListWatched returned error: %v", err) } diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/doc.go b/Godeps/_workspace/src/github.com/google/go-github/github/doc.go index b4ac8e6..e2066f1 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/doc.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/doc.go @@ -74,7 +74,7 @@ The GitHub API has good support for conditional requests which will help prevent you from burning through your rate limit, as well as help speed up your application. go-github does not handle conditional requests directly, but is instead designed to work with a caching http.Transport. We recommend using -https://github.com/gregjones/httpcache, which can be used in conjuction with +https://github.com/gregjones/httpcache, which can be used in conjunction with https://github.com/sourcegraph/apiproxy to provide additional flexibility and control of caching rules. diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/github.go b/Godeps/_workspace/src/github.com/google/go-github/github/github.go index 30b8390..344cbff 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/github.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/github.go @@ -17,6 +17,7 @@ import ( "reflect" "strconv" "strings" + "sync" "time" "github.com/google/go-querystring/query" @@ -31,6 +32,7 @@ const ( headerRateLimit = "X-RateLimit-Limit" headerRateRemaining = "X-RateLimit-Remaining" headerRateReset = "X-RateLimit-Reset" + headerOTP = "X-GitHub-OTP" mediaTypeV3 = "application/vnd.github.v3+json" defaultMediaType = "application/octet-stream" @@ -46,6 +48,9 @@ const ( // https://developer.github.com/changes/2015-06-24-api-enhancements-for-working-with-organization-permissions/ mediaTypeOrgPermissionPreview = "application/vnd.github.ironman-preview+json" mediaTypeOrgPermissionRepoPreview = "application/vnd.github.ironman-preview.repository+json" + + // https://developer.github.com/changes/2015-11-11-protected-branches-api/ + mediaTypeProtectedBranchesPreview = "application/vnd.github.loki-preview+json" ) // A Client manages communication with the GitHub API. @@ -64,11 +69,8 @@ type Client struct { // User agent used when communicating with the GitHub API. UserAgent string - // Rate specifies the current rate limit for the client as determined by the - // most recent API call. If the client is used in a multi-user application, - // this rate may not always be up-to-date. Call RateLimits() to check the - // current rate. - Rate Rate + rateMu sync.Mutex + rate Rate // Services used for talking to different parts of the GitHub API. Activity *ActivityService @@ -292,6 +294,17 @@ func (r *Response) populateRate() { } } +// Rate specifies the current rate limit for the client as determined by the +// most recent API call. If the client is used in a multi-user application, +// this rate may not always be up-to-date. Call RateLimits() to check the +// current rate. +func (c *Client) Rate() Rate { + c.rateMu.Lock() + rate := c.rate + c.rateMu.Unlock() + return rate +} + // Do sends an API request and returns the API response. The API response is // JSON decoded and stored in the value pointed to by v, or returned as an // error if an API error has occurred. If v implements the io.Writer @@ -307,7 +320,9 @@ func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) { response := newResponse(resp) - c.Rate = response.Rate + c.rateMu.Lock() + c.rate = response.Rate + c.rateMu.Unlock() err = CheckResponse(resp) if err != nil { @@ -321,6 +336,9 @@ func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) { io.Copy(w, resp.Body) } else { err = json.NewDecoder(resp.Body).Decode(v) + if err == io.EOF { + err = nil // ignore EOF errors caused by empty response body + } } } return response, err @@ -343,8 +361,15 @@ func (r *ErrorResponse) Error() string { r.Response.StatusCode, r.Message, r.Errors) } -// sanitizeURL redacts the client_id and client_secret tokens from the URL which -// may be exposed to the user, specifically in the ErrorResponse error message. +// TwoFactorAuthError occurs when using HTTP Basic Authentication for a user +// that has two-factor authentication enabled. The request can be reattempted +// by providing a one-time password in the request. +type TwoFactorAuthError ErrorResponse + +func (r *TwoFactorAuthError) Error() string { return (*ErrorResponse)(r).Error() } + +// sanitizeURL redacts the client_secret parameter from the URL which may be +// exposed to the user, specifically in the ErrorResponse error message. func sanitizeURL(uri *url.URL) *url.URL { if uri == nil { return nil @@ -397,6 +422,9 @@ func CheckResponse(r *http.Response) error { if err == nil && data != nil { json.Unmarshal(data, errorResponse) } + if r.StatusCode == http.StatusUnauthorized && strings.HasPrefix(r.Header.Get(headerOTP), "required") { + return (*TwoFactorAuthError)(errorResponse) + } return errorResponse } @@ -548,6 +576,43 @@ func (t *UnauthenticatedRateLimitedTransport) transport() http.RoundTripper { return http.DefaultTransport } +// BasicAuthTransport is an http.RoundTripper that authenticates all requests +// using HTTP Basic Authentication with the provided username and password. It +// additionally supports users who have two-factor authentication enabled on +// their GitHub account. +type BasicAuthTransport struct { + Username string // GitHub username + Password string // GitHub password + OTP string // one-time password for users with two-factor auth enabled + + // Transport is the underlying HTTP transport to use when making requests. + // It will default to http.DefaultTransport if nil. + Transport http.RoundTripper +} + +// RoundTrip implements the RoundTripper interface. +func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) { + req = cloneRequest(req) // per RoundTrip contract + req.SetBasicAuth(t.Username, t.Password) + if t.OTP != "" { + req.Header.Add(headerOTP, t.OTP) + } + return t.transport().RoundTrip(req) +} + +// Client returns an *http.Client that makes requests that are authenticated +// using HTTP Basic Authentication. +func (t *BasicAuthTransport) Client() *http.Client { + return &http.Client{Transport: t} +} + +func (t *BasicAuthTransport) transport() http.RoundTripper { + if t.Transport != nil { + return t.Transport + } + return http.DefaultTransport +} + // cloneRequest returns a clone of the provided *http.Request. The clone is a // shallow copy of the struct and its Header map. func cloneRequest(r *http.Request) *http.Request { @@ -555,9 +620,9 @@ func cloneRequest(r *http.Request) *http.Request { r2 := new(http.Request) *r2 = *r // deep copy of the Header - r2.Header = make(http.Header) + r2.Header = make(http.Header, len(r.Header)) for k, s := range r.Header { - r2.Header[k] = s + r2.Header[k] = append([]string(nil), s...) } return r2 } diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/github_test.go b/Godeps/_workspace/src/github.com/google/go-github/github/github_test.go index f4626f4..b02076d 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/github_test.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/github_test.go @@ -378,28 +378,28 @@ func TestDo_rateLimit(t *testing.T) { w.Header().Add(headerRateReset, "1372700873") }) - if got, want := client.Rate.Limit, 0; got != want { + if got, want := client.Rate().Limit, 0; got != want { t.Errorf("Client rate limit = %v, want %v", got, want) } - if got, want := client.Rate.Remaining, 0; got != want { + if got, want := client.Rate().Remaining, 0; got != want { t.Errorf("Client rate remaining = %v, got %v", got, want) } - if !client.Rate.Reset.IsZero() { + if !client.Rate().Reset.IsZero() { t.Errorf("Client rate reset not initialized to zero value") } req, _ := client.NewRequest("GET", "/", nil) client.Do(req, nil) - if got, want := client.Rate.Limit, 60; got != want { + if got, want := client.Rate().Limit, 60; got != want { t.Errorf("Client rate limit = %v, want %v", got, want) } - if got, want := client.Rate.Remaining, 59; got != want { + if got, want := client.Rate().Remaining, 59; got != want { t.Errorf("Client rate remaining = %v, want %v", got, want) } reset := time.Date(2013, 7, 1, 17, 47, 53, 0, time.UTC) - if client.Rate.Reset.UTC() != reset { - t.Errorf("Client rate reset = %v, want %v", client.Rate.Reset, reset) + if client.Rate().Reset.UTC() != reset { + t.Errorf("Client rate reset = %v, want %v", client.Rate().Reset, reset) } } @@ -418,15 +418,33 @@ func TestDo_rateLimit_errorResponse(t *testing.T) { req, _ := client.NewRequest("GET", "/", nil) client.Do(req, nil) - if got, want := client.Rate.Limit, 60; got != want { + if got, want := client.Rate().Limit, 60; got != want { t.Errorf("Client rate limit = %v, want %v", got, want) } - if got, want := client.Rate.Remaining, 59; got != want { + if got, want := client.Rate().Remaining, 59; got != want { t.Errorf("Client rate remaining = %v, want %v", got, want) } reset := time.Date(2013, 7, 1, 17, 47, 53, 0, time.UTC) - if client.Rate.Reset.UTC() != reset { - t.Errorf("Client rate reset = %v, want %v", client.Rate.Reset, reset) + if client.Rate().Reset.UTC() != reset { + t.Errorf("Client rate reset = %v, want %v", client.Rate().Reset, reset) + } +} + +func TestDo_noContent(t *testing.T) { + setup() + defer teardown() + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNoContent) + }) + + var body json.RawMessage + + req, _ := client.NewRequest("GET", "/", nil) + _, err := client.Do(req, &body) + + if err != nil { + t.Fatalf("Do returned unexpected error: %v", err) } } @@ -453,7 +471,7 @@ func TestCheckResponse(t *testing.T) { res := &http.Response{ Request: &http.Request{}, StatusCode: http.StatusBadRequest, - Body: ioutil.NopCloser(strings.NewReader(`{"message":"m", + Body: ioutil.NopCloser(strings.NewReader(`{"message":"m", "errors": [{"resource": "r", "field": "f", "code": "c"}]}`)), } err := CheckResponse(res).(*ErrorResponse) @@ -677,3 +695,52 @@ func TestUnauthenticatedRateLimitedTransport_transport(t *testing.T) { t.Errorf("Expected custom transport to be used.") } } + +func TestBasicAuthTransport(t *testing.T) { + setup() + defer teardown() + + username, password, otp := "u", "p", "123456" + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + u, p, ok := r.BasicAuth() + if !ok { + t.Errorf("request does not contain basic auth credentials") + } + if u != username { + t.Errorf("request contained basic auth username %q, want %q", u, username) + } + if p != password { + t.Errorf("request contained basic auth password %q, want %q", p, password) + } + if got, want := r.Header.Get(headerOTP), otp; got != want { + t.Errorf("request contained OTP %q, want %q", got, want) + } + }) + + tp := &BasicAuthTransport{ + Username: username, + Password: password, + OTP: otp, + } + basicAuthClient := NewClient(tp.Client()) + basicAuthClient.BaseURL = client.BaseURL + req, _ := basicAuthClient.NewRequest("GET", "/", nil) + basicAuthClient.Do(req, nil) +} + +func TestBasicAuthTransport_transport(t *testing.T) { + // default transport + tp := &BasicAuthTransport{} + if tp.transport() != http.DefaultTransport { + t.Errorf("Expected http.DefaultTransport to be used.") + } + + // custom transport + tp = &BasicAuthTransport{ + Transport: &http.Transport{}, + } + if tp.transport() == http.DefaultTransport { + t.Errorf("Expected custom transport to be used.") + } +} diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/issues.go b/Godeps/_workspace/src/github.com/google/go-github/github/issues.go index 14fcb7f..a60cede 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/issues.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/issues.go @@ -76,7 +76,7 @@ type IssueListOptions struct { Sort string `url:"sort,omitempty"` // Direction in which to sort issues. Possible values are: asc, desc. - // Default is "asc". + // Default is "desc". Direction string `url:"direction,omitempty"` // Since filters issues by time. @@ -170,7 +170,7 @@ type IssueListByRepoOptions struct { Sort string `url:"sort,omitempty"` // Direction in which to sort issues. Possible values are: asc, desc. - // Default is "asc". + // Default is "desc". Direction string `url:"direction,omitempty"` // Since filters issues by time. diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go b/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go index c326ff8..01a9ba9 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go @@ -52,7 +52,7 @@ type ListMembersOptions struct { // 2fa_disabled, all. Default is "all". Filter string `url:"filter,omitempty"` - // Role filters memebers returned by their role in the organization. + // Role filters members returned by their role in the organization. // Possible values are: // all - all members of the organization, regardless of role // admin - organization owners diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/repos.go b/Godeps/_workspace/src/github.com/google/go-github/github/repos.go index 2e9b29e..c9eb37a 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/repos.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/repos.go @@ -448,8 +448,27 @@ func (s *RepositoriesService) ListTags(owner string, repo string, opt *ListOptio // Branch represents a repository branch type Branch struct { - Name *string `json:"name,omitempty"` - Commit *Commit `json:"commit,omitempty"` + Name *string `json:"name,omitempty"` + Commit *Commit `json:"commit,omitempty"` + Protection *Protection `json:"protection,omitempty"` +} + +// Protection represents a repository branch's protection +type Protection struct { + Enabled *bool `json:"enabled,omitempty"` + RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks,omitempty"` +} + +// RequiredStatusChecks represents the protection status of a individual branch +type RequiredStatusChecks struct { + // Who required status checks apply to. + // Possible values are: + // off + // non_admins + // everyone + EnforcementLevel *string `json:"enforcement_level,omitempty"` + // The list of status checks which are required + Contexts *[]string `json:"contexts,omitempty"` } // ListBranches lists branches for the specified repository. @@ -486,6 +505,8 @@ func (s *RepositoriesService) GetBranch(owner, repo, branch string) (*Branch, *R return nil, nil, err } + req.Header.Set("Accept", mediaTypeProtectedBranchesPreview) + b := new(Branch) resp, err := s.client.Do(req, b) if err != nil { diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/repos_hooks.go b/Godeps/_workspace/src/github.com/google/go-github/github/repos_hooks.go index bc4c8c5..36734ff 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/repos_hooks.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/repos_hooks.go @@ -70,6 +70,7 @@ type Hook struct { CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` Events []string `json:"events,omitempty"` Active *bool `json:"active,omitempty"` Config map[string]interface{} `json:"config,omitempty"` diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/repos_test.go b/Godeps/_workspace/src/github.com/google/go-github/github/repos_test.go index 6e98e28..b882156 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/repos_test.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/repos_test.go @@ -389,7 +389,8 @@ func TestRepositoriesService_GetBranch(t *testing.T) { mux.HandleFunc("/repos/o/r/branches/b", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s"}}`) + testHeader(t, r, "Accept", mediaTypeProtectedBranchesPreview) + fmt.Fprint(w, `{"name":"n", "commit":{"sha":"s"}, "protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone","contexts": []}}}`) }) branch, _, err := client.Repositories.GetBranch("o", "r", "b") @@ -397,7 +398,18 @@ func TestRepositoriesService_GetBranch(t *testing.T) { t.Errorf("Repositories.GetBranch returned error: %v", err) } - want := &Branch{Name: String("n"), Commit: &Commit{SHA: String("s")}} + want := &Branch{ + Name: String("n"), + Commit: &Commit{SHA: String("s")}, + Protection: &Protection{ + Enabled: Bool(true), + RequiredStatusChecks: &RequiredStatusChecks{ + EnforcementLevel: String("everyone"), + Contexts: &[]string{}, + }, + }, + } + if !reflect.DeepEqual(branch, want) { t.Errorf("Repositories.GetBranch returned %+v, want %+v", branch, want) } diff --git a/Godeps/_workspace/src/github.com/pkg/sftp/.travis.yml b/Godeps/_workspace/src/github.com/pkg/sftp/.travis.yml index a4fb252..9ef70d8 100644 --- a/Godeps/_workspace/src/github.com/pkg/sftp/.travis.yml +++ b/Godeps/_workspace/src/github.com/pkg/sftp/.travis.yml @@ -17,3 +17,5 @@ install: script: - go test -integration -v ./... + - go test -testserver -v ./... + - go test -integration -testserver -v ./... diff --git a/Godeps/_workspace/src/github.com/pkg/sftp/client.go b/Godeps/_workspace/src/github.com/pkg/sftp/client.go index 7a8e442..c5cc0ce 100644 --- a/Godeps/_workspace/src/github.com/pkg/sftp/client.go +++ b/Godeps/_workspace/src/github.com/pkg/sftp/client.go @@ -224,7 +224,7 @@ func (c *Client) ReadDir(p string) ([]os.FileInfo, error) { } case ssh_FXP_STATUS: // TODO(dfc) scope warning! - err = eofOrErr(unmarshalStatus(id, data)) + err = normaliseError(unmarshalStatus(id, data)) done = true default: return nil, unimplementedPacketErr(typ) @@ -280,7 +280,7 @@ func (c *Client) Stat(p string) (os.FileInfo, error) { attr, _ := unmarshalAttrs(data) return fileInfoFromStat(attr, path.Base(p)), nil case ssh_FXP_STATUS: - return nil, unmarshalStatus(id, data) + return nil, normaliseError(unmarshalStatus(id, data)) default: return nil, unimplementedPacketErr(typ) } @@ -306,7 +306,7 @@ func (c *Client) Lstat(p string) (os.FileInfo, error) { attr, _ := unmarshalAttrs(data) return fileInfoFromStat(attr, path.Base(p)), nil case ssh_FXP_STATUS: - return nil, unmarshalStatus(id, data) + return nil, normaliseError(unmarshalStatus(id, data)) default: return nil, unimplementedPacketErr(typ) } @@ -354,7 +354,7 @@ func (c *Client) Symlink(oldname, newname string) error { } switch typ { case ssh_FXP_STATUS: - return okOrErr(unmarshalStatus(id, data)) + return normaliseError(unmarshalStatus(id, data)) default: return unimplementedPacketErr(typ) } @@ -374,7 +374,7 @@ func (c *Client) setstat(path string, flags uint32, attrs interface{}) error { } switch typ { case ssh_FXP_STATUS: - return okOrErr(unmarshalStatus(id, data)) + return normaliseError(unmarshalStatus(id, data)) default: return unimplementedPacketErr(typ) } @@ -446,7 +446,7 @@ func (c *Client) open(path string, pflags uint32) (*File, error) { handle, _ := unmarshalString(data) return &File{c: c, path: path, handle: handle}, nil case ssh_FXP_STATUS: - return nil, unmarshalStatus(id, data) + return nil, normaliseError(unmarshalStatus(id, data)) default: return nil, unimplementedPacketErr(typ) } @@ -466,7 +466,7 @@ func (c *Client) close(handle string) error { } switch typ { case ssh_FXP_STATUS: - return okOrErr(unmarshalStatus(id, data)) + return normaliseError(unmarshalStatus(id, data)) default: return unimplementedPacketErr(typ) } @@ -567,7 +567,7 @@ func (c *Client) removeFile(path string) error { } switch typ { case ssh_FXP_STATUS: - return okOrErr(unmarshalStatus(id, data)) + return normaliseError(unmarshalStatus(id, data)) default: return unimplementedPacketErr(typ) } @@ -584,7 +584,7 @@ func (c *Client) removeDirectory(path string) error { } switch typ { case ssh_FXP_STATUS: - return okOrErr(unmarshalStatus(id, data)) + return normaliseError(unmarshalStatus(id, data)) default: return unimplementedPacketErr(typ) } @@ -603,7 +603,7 @@ func (c *Client) Rename(oldname, newname string) error { } switch typ { case ssh_FXP_STATUS: - return okOrErr(unmarshalStatus(id, data)) + return normaliseError(unmarshalStatus(id, data)) default: return unimplementedPacketErr(typ) } @@ -631,7 +631,7 @@ func (c *Client) realpath(path string) (string, error) { filename, _ := unmarshalString(data) // ignore attributes return filename, nil case ssh_FXP_STATUS: - return "", okOrErr(unmarshalStatus(id, data)) + return "", normaliseError(unmarshalStatus(id, data)) default: return "", unimplementedPacketErr(typ) } @@ -686,7 +686,7 @@ func (c *Client) Mkdir(path string) error { } switch typ { case ssh_FXP_STATUS: - return okOrErr(unmarshalStatus(id, data)) + return normaliseError(unmarshalStatus(id, data)) default: return unimplementedPacketErr(typ) } @@ -789,7 +789,10 @@ func (f *File) Read(b []byte) (int, error) { switch res.typ { case ssh_FXP_STATUS: if firstErr.err == nil || req.offset < firstErr.offset { - firstErr = offsetErr{offset: req.offset, err: eofOrErr(unmarshalStatus(reqId, res.data))} + firstErr = offsetErr{ + offset: req.offset, + err: normaliseError(unmarshalStatus(reqId, res.data)), + } break } case ssh_FXP_DATA: @@ -887,7 +890,7 @@ func (f *File) WriteTo(w io.Writer) (int64, error) { switch res.typ { case ssh_FXP_STATUS: if firstErr.err == nil || req.offset < firstErr.offset { - firstErr = offsetErr{offset: req.offset, err: eofOrErr(unmarshalStatus(reqId, res.data))} + firstErr = offsetErr{offset: req.offset, err: normaliseError(unmarshalStatus(reqId, res.data))} break } case ssh_FXP_DATA: @@ -996,7 +999,7 @@ func (f *File) Write(b []byte) (int, error) { switch res.typ { case ssh_FXP_STATUS: id, _ := unmarshalUint32(res.data) - err := okOrErr(unmarshalStatus(id, res.data)) + err := normaliseError(unmarshalStatus(id, res.data)) if err != nil && firstErr == nil { firstErr = err break @@ -1062,7 +1065,7 @@ func (f *File) ReadFrom(r io.Reader) (int64, error) { switch res.typ { case ssh_FXP_STATUS: id, _ := unmarshalUint32(res.data) - err := okOrErr(unmarshalStatus(id, res.data)) + err := normaliseError(unmarshalStatus(id, res.data)) if err != nil && firstErr == nil { firstErr = err break @@ -1135,19 +1138,24 @@ func min(a, b int) int { return a } -// okOrErr returns nil if Err.Code is SSH_FX_OK, otherwise it returns the error. -func okOrErr(err error) error { - if err, ok := err.(*StatusError); ok && err.Code == ssh_FX_OK { - return nil - } - return err -} - -func eofOrErr(err error) error { - if err, ok := err.(*StatusError); ok && err.Code == ssh_FX_EOF { - return io.EOF +// normaliseError normalises an error into a more standard form that can be +// checked against stdlib errors like io.EOF or os.ErrNotExist. +func normaliseError(err error) error { + switch err := err.(type) { + case *StatusError: + switch err.Code { + case ssh_FX_EOF: + return io.EOF + case ssh_FX_NO_SUCH_FILE: + return os.ErrNotExist + case ssh_FX_OK: + return nil + default: + return err + } + default: + return err } - return err } func unmarshalStatus(id uint32, data []byte) error { diff --git a/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_darwin_test.go b/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_darwin_test.go index b3fb168..0f7cd01 100644 --- a/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_darwin_test.go +++ b/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_darwin_test.go @@ -8,6 +8,9 @@ import ( const sftpServer = "/usr/libexec/sftp-server" func TestClientStatVFS(t *testing.T) { + if *testServerImpl { + t.Skipf("go server does not support FXP_EXTENDED") + } sftp, cmd := testClient(t, READWRITE, NO_DELAY) defer cmd.Wait() defer sftp.Close() diff --git a/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_linux_test.go b/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_linux_test.go index 3e74bfa..1663ad4 100644 --- a/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_linux_test.go +++ b/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_linux_test.go @@ -8,6 +8,9 @@ import ( const sftpServer = "/usr/lib/openssh/sftp-server" func TestClientStatVFS(t *testing.T) { + if *testServerImpl { + t.Skipf("go server does not support FXP_EXTENDED") + } sftp, cmd := testClient(t, READWRITE, NO_DELAY) defer cmd.Wait() defer sftp.Close() diff --git a/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_test.go b/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_test.go index b4f995a..e6d723a 100644 --- a/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_test.go +++ b/Godeps/_workspace/src/github.com/pkg/sftp/client_integration_test.go @@ -85,8 +85,14 @@ func (w delayedWriter) Close() error { } func testClientGoSvr(t testing.TB, readonly bool, delay time.Duration) (*Client, *exec.Cmd) { - txPipeRd, txPipeWr := io.Pipe() - rxPipeRd, rxPipeWr := io.Pipe() + txPipeRd, txPipeWr, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + rxPipeRd, rxPipeWr, err := os.Pipe() + if err != nil { + t.Fatal(err) + } server, err := NewServer(txPipeRd, rxPipeWr, os.Stderr, 0, readonly, ".") if err != nil { @@ -182,7 +188,7 @@ func TestClientLstat(t *testing.T) { } } -func TestClientLstatMissing(t *testing.T) { +func TestClientLstatIsNotExist(t *testing.T) { sftp, cmd := testClient(t, READONLY, NO_DELAY) defer cmd.Wait() defer sftp.Close() @@ -193,9 +199,8 @@ func TestClientLstatMissing(t *testing.T) { } os.Remove(f.Name()) - _, err = sftp.Lstat(f.Name()) - if err1, ok := err.(*StatusError); !ok || err1.Code != ssh_FX_NO_SUCH_FILE { - t.Fatalf("Lstat: want: %v, got %#v", ssh_FX_NO_SUCH_FILE, err) + if _, err := sftp.Lstat(f.Name()); !os.IsNotExist(err) { + t.Errorf("os.IsNotExist(%v) = false, want true", err) } } @@ -237,6 +242,26 @@ func TestClientOpen(t *testing.T) { } } +func TestClientOpenIsNotExist(t *testing.T) { + sftp, cmd := testClient(t, READONLY, NO_DELAY) + defer cmd.Wait() + defer sftp.Close() + + if _, err := sftp.Open("/doesnt/exist/"); !os.IsNotExist(err) { + t.Errorf("os.IsNotExist(%v) = false, want true", err) + } +} + +func TestClientStatIsNotExist(t *testing.T) { + sftp, cmd := testClient(t, READONLY, NO_DELAY) + defer cmd.Wait() + defer sftp.Close() + + if _, err := sftp.Stat("/doesnt/exist/"); !os.IsNotExist(err) { + t.Errorf("os.IsNotExist(%v) = false, want true", err) + } +} + const seekBytes = 128 * 1024 type seek struct { @@ -1217,7 +1242,12 @@ func TestClientWalk(t *testing.T) { // sftp/issue/42, abrupt server hangup would result in client hangs. func TestServerRoughDisconnect(t *testing.T) { + if *testServerImpl { + t.Skipf("skipping with -testserver") + } sftp, cmd := testClient(t, READONLY, NO_DELAY) + defer cmd.Wait() + defer sftp.Close() f, err := sftp.Open("/dev/zero") if err != nil { @@ -1230,7 +1260,6 @@ func TestServerRoughDisconnect(t *testing.T) { }() io.Copy(ioutil.Discard, f) - sftp.Close() } // sftp/issue/26 writing to a read only file caused client to loop. diff --git a/Godeps/_workspace/src/github.com/pkg/sftp/client_test.go b/Godeps/_workspace/src/github.com/pkg/sftp/client_test.go index 2da179c..8d5f080 100644 --- a/Godeps/_workspace/src/github.com/pkg/sftp/client_test.go +++ b/Godeps/_workspace/src/github.com/pkg/sftp/client_test.go @@ -1,6 +1,7 @@ package sftp import ( + "errors" "io" "os" "testing" @@ -14,42 +15,54 @@ var _ fs.FileSystem = new(Client) // assert that *File implements io.ReadWriteCloser var _ io.ReadWriteCloser = new(File) -var ok = &StatusError{Code: ssh_FX_OK} -var eof = &StatusError{Code: ssh_FX_EOF} -var fail = &StatusError{Code: ssh_FX_FAILURE} +func TestNormaliseError(t *testing.T) { + var ( + ok = &StatusError{Code: ssh_FX_OK} + eof = &StatusError{Code: ssh_FX_EOF} + fail = &StatusError{Code: ssh_FX_FAILURE} + noSuchFile = &StatusError{Code: ssh_FX_NO_SUCH_FILE} + foo = errors.New("foo") + ) -var eofOrErrTests = []struct { - err, want error -}{ - {nil, nil}, - {eof, io.EOF}, - {ok, ok}, - {io.EOF, io.EOF}, -} - -func TestEofOrErr(t *testing.T) { - for _, tt := range eofOrErrTests { - got := eofOrErr(tt.err) - if got != tt.want { - t.Errorf("eofOrErr(%#v): want: %#v, got: %#v", tt.err, tt.want, got) - } + var tests = []struct { + desc string + err error + want error + }{ + { + desc: "nil error", + }, + { + desc: "not *StatusError", + err: foo, + want: foo, + }, + { + desc: "*StatusError with ssh_FX_EOF", + err: eof, + want: io.EOF, + }, + { + desc: "*StatusError with ssh_FX_NO_SUCH_FILE", + err: noSuchFile, + want: os.ErrNotExist, + }, + { + desc: "*StatusError with ssh_FX_OK", + err: ok, + }, + { + desc: "*StatusError with ssh_FX_FAILURE", + err: fail, + want: fail, + }, } -} - -var okOrErrTests = []struct { - err, want error -}{ - {nil, nil}, - {eof, eof}, - {ok, nil}, - {io.EOF, io.EOF}, -} -func TestOkOrErr(t *testing.T) { - for _, tt := range okOrErrTests { - got := okOrErr(tt.err) + for _, tt := range tests { + got := normaliseError(tt.err) if got != tt.want { - t.Errorf("okOrErr(%#v): want: %#v, got: %#v", tt.err, tt.want, got) + t.Errorf("normaliseError(%#v), test %q\n- want: %#v\n- got: %#v", + tt.err, tt.desc, tt.want, got) } } } diff --git a/Godeps/_workspace/src/github.com/pkg/sftp/server.go b/Godeps/_workspace/src/github.com/pkg/sftp/server.go index 3b6c917..a0b0f08 100644 --- a/Godeps/_workspace/src/github.com/pkg/sftp/server.go +++ b/Godeps/_workspace/src/github.com/pkg/sftp/server.go @@ -53,9 +53,9 @@ func (svr *Server) closeHandle(handle string) error { if f, ok := svr.openFiles[handle]; ok { delete(svr.openFiles, handle) return f.Close() - } else { - return syscall.EBADF } + + return syscall.EBADF } func (svr *Server) getHandle(handle string) (*os.File, bool) { @@ -75,11 +75,12 @@ type serverRespondablePacket interface { // A subsequent call to Serve() is required. func NewServer(in io.Reader, out io.WriteCloser, debugStream io.Writer, debugLevel int, readOnly bool, rootDir string) (*Server, error) { if rootDir == "" { - if wd, err := os.Getwd(); err != nil { + wd, err := os.Getwd() + if err != nil { return nil, err - } else { - rootDir = wd } + + rootDir = wd } return &Server{ in: in, @@ -108,29 +109,30 @@ func (svr *Server) rxPackets() error { for { pktType, pktBytes, err := recvPacket(svr.in) - if err == io.EOF { - fmt.Fprintf(svr.debugStream, "rxPackets loop done\n") + switch err { + case nil: + svr.pktChan <- rxPacket{fxp(pktType), pktBytes} + case io.EOF: return nil - } else if err != nil { + default: fmt.Fprintf(svr.debugStream, "recvPacket error: %v\n", err) return err } - - svr.pktChan <- rxPacket{fxp(pktType), pktBytes} } } // Up to N parallel servers func (svr *Server) sftpServerWorker(doneChan chan error) { for pkt := range svr.pktChan { - if pkt, err := svr.decodePacket(pkt.pktType, pkt.pktBytes); err != nil { + dPkt, err := svr.decodePacket(pkt.pktType, pkt.pktBytes) + if err != nil { fmt.Fprintf(svr.debugStream, "decodePacket error: %v\n", err) doneChan <- err return - } else { - //fmt.Fprintf(svr.debugStream, "pkt: %T %v\n", pkt, pkt) - pkt.respond(svr) } + + //fmt.Fprintf(svr.debugStream, "pkt: %T %v\n", pkt, pkt) + dPkt.respond(svr) } doneChan <- nil } @@ -148,7 +150,6 @@ func (svr *Server) Serve() error { break } } - fmt.Fprintf(svr.debugStream, "sftp server run finished\n") // close any still-open files for handle, file := range svr.openFiles { fmt.Fprintf(svr.debugStream, "sftp server file with handle '%v' left open: %v\n", handle, file.Name()) @@ -158,7 +159,6 @@ func (svr *Server) Serve() error { } func (svr *Server) decodePacket(pktType fxp, pktBytes []byte) (serverRespondablePacket, error) { - //pktId, restBytes := unmarshalUint32(pktBytes[1:]) var pkt serverRespondablePacket = nil switch pktType { case ssh_FXP_INIT: @@ -200,15 +200,10 @@ func (svr *Server) decodePacket(pktType fxp, pktBytes []byte) (serverRespondable case ssh_FXP_SYMLINK: pkt = &sshFxpSymlinkPacket{} default: - return nil, fmt.Errorf("unhandled packet type: %s", pktType.String()) - } - if pkt == nil { - return nil, fmt.Errorf("unhandled packet type: %s", pktType.String()) - } - if err := pkt.UnmarshalBinary(pktBytes); err != nil { - return nil, err + return nil, fmt.Errorf("unhandled packet type: %s", pktType) } - return pkt, nil + err := pkt.UnmarshalBinary(pktBytes) + return pkt, err } func (p sshFxInitPacket) respond(svr *Server) error { @@ -229,30 +224,45 @@ func (p sshFxpStatResponse) MarshalBinary() ([]byte, error) { func (p sshFxpLstatPacket) respond(svr *Server) error { // stat the requested file - if info, err := os.Lstat(p.Path); err != nil { + info, err := os.Lstat(p.Path) + if err != nil { return svr.sendPacket(statusFromError(p.Id, err)) - } else { - return svr.sendPacket(sshFxpStatResponse{p.Id, info}) } + + return svr.sendPacket(sshFxpStatResponse{ + Id: p.Id, + info: info, + }) } func (p sshFxpStatPacket) respond(svr *Server) error { // stat the requested file - if info, err := os.Stat(p.Path); err != nil { + info, err := os.Stat(p.Path) + if err != nil { return svr.sendPacket(statusFromError(p.Id, err)) - } else { - return svr.sendPacket(sshFxpStatResponse{p.Id, info}) } + + return svr.sendPacket(sshFxpStatResponse{ + Id: p.Id, + info: info, + }) } func (p sshFxpFstatPacket) respond(svr *Server) error { - if f, ok := svr.getHandle(p.Handle); !ok { + f, ok := svr.getHandle(p.Handle) + if !ok { return svr.sendPacket(statusFromError(p.Id, syscall.EBADF)) - } else if info, err := f.Stat(); err != nil { + } + + info, err := f.Stat() + if err != nil { return svr.sendPacket(statusFromError(p.Id, err)) - } else { - return svr.sendPacket(sshFxpStatResponse{p.Id, info}) } + + return svr.sendPacket(sshFxpStatResponse{ + Id: p.Id, + info: info, + }) } func (p sshFxpMkdirPacket) respond(svr *Server) error { @@ -299,28 +309,49 @@ func (p sshFxpSymlinkPacket) respond(svr *Server) error { var emptyFileStat = []interface{}{uint32(0)} func (p sshFxpReadlinkPacket) respond(svr *Server) error { - if f, err := os.Readlink(p.Path); err != nil { + f, err := os.Readlink(p.Path) + if err != nil { return svr.sendPacket(statusFromError(p.Id, err)) - } else { - return svr.sendPacket(sshFxpNamePacket{p.Id, []sshFxpNameAttr{sshFxpNameAttr{f, f, emptyFileStat}}}) } + + return svr.sendPacket(sshFxpNamePacket{ + Id: p.Id, + NameAttrs: []sshFxpNameAttr{{ + Name: f, + LongName: f, + Attrs: emptyFileStat, + }}, + }) } func (p sshFxpRealpathPacket) respond(svr *Server) error { - if f, err := filepath.Abs(p.Path); err != nil { + f, err := filepath.Abs(p.Path) + if err != nil { return svr.sendPacket(statusFromError(p.Id, err)) - } else { - f = filepath.Clean(f) - return svr.sendPacket(sshFxpNamePacket{p.Id, []sshFxpNameAttr{sshFxpNameAttr{f, f, emptyFileStat}}}) } + + f = filepath.Clean(f) + + return svr.sendPacket(sshFxpNamePacket{ + Id: p.Id, + NameAttrs: []sshFxpNameAttr{{ + Name: f, + LongName: f, + Attrs: emptyFileStat, + }}, + }) } func (p sshFxpOpendirPacket) respond(svr *Server) error { - return sshFxpOpenPacket{p.Id, p.Path, ssh_FXF_READ, 0}.respond(svr) + return sshFxpOpenPacket{ + Id: p.Id, + Path: p.Path, + Pflags: ssh_FXF_READ, + }.respond(svr) } func (p sshFxpOpenPacket) respond(svr *Server) error { - osFlags := 0 + var osFlags int if p.Pflags&ssh_FXF_READ != 0 && p.Pflags&ssh_FXF_WRITE != 0 { if svr.readOnly { return svr.sendPacket(statusFromError(p.Id, syscall.EPERM)) @@ -352,12 +383,13 @@ func (p sshFxpOpenPacket) respond(svr *Server) error { osFlags |= os.O_EXCL } - if f, err := os.OpenFile(p.Path, osFlags, 0644); err != nil { + f, err := os.OpenFile(p.Path, osFlags, 0644) + if err != nil { return svr.sendPacket(statusFromError(p.Id, err)) - } else { - handle := svr.nextHandle(f) - return svr.sendPacket(sshFxpHandlePacket{p.Id, handle}) } + + handle := svr.nextHandle(f) + return svr.sendPacket(sshFxpHandlePacket{p.Id, handle}) } func (p sshFxpClosePacket) respond(svr *Server) error { @@ -365,20 +397,27 @@ func (p sshFxpClosePacket) respond(svr *Server) error { } func (p sshFxpReadPacket) respond(svr *Server) error { - if f, ok := svr.getHandle(p.Handle); !ok { + f, ok := svr.getHandle(p.Handle) + if !ok { return svr.sendPacket(statusFromError(p.Id, syscall.EBADF)) - } else { - if p.Len > svr.maxTxPacket { - p.Len = svr.maxTxPacket - } - ret := sshFxpDataPacket{Id: p.Id, Length: p.Len, Data: make([]byte, p.Len)} - if n, err := f.ReadAt(ret.Data, int64(p.Offset)); err != nil && (err != io.EOF || n == 0) { - return svr.sendPacket(statusFromError(p.Id, err)) - } else { - ret.Length = uint32(n) - return svr.sendPacket(ret) - } } + + if p.Len > svr.maxTxPacket { + p.Len = svr.maxTxPacket + } + ret := sshFxpDataPacket{ + Id: p.Id, + Length: p.Len, + Data: make([]byte, p.Len), + } + + n, err := f.ReadAt(ret.Data, int64(p.Offset)) + if err != nil && (err != io.EOF || n == 0) { + return svr.sendPacket(statusFromError(p.Id, err)) + } + + ret.Length = uint32(n) + return svr.sendPacket(ret) } func (p sshFxpWritePacket) respond(svr *Server) error { @@ -386,146 +425,147 @@ func (p sshFxpWritePacket) respond(svr *Server) error { // shouldn't really get here, the open should have failed return svr.sendPacket(statusFromError(p.Id, syscall.EPERM)) } - if f, ok := svr.getHandle(p.Handle); !ok { + + f, ok := svr.getHandle(p.Handle) + if !ok { return svr.sendPacket(statusFromError(p.Id, syscall.EBADF)) - } else { - _, err := f.WriteAt(p.Data, int64(p.Offset)) - return svr.sendPacket(statusFromError(p.Id, err)) } + + _, err := f.WriteAt(p.Data, int64(p.Offset)) + return svr.sendPacket(statusFromError(p.Id, err)) } func (p sshFxpReaddirPacket) respond(svr *Server) error { - if f, ok := svr.getHandle(p.Handle); !ok { + f, ok := svr.getHandle(p.Handle) + if !ok { return svr.sendPacket(statusFromError(p.Id, syscall.EBADF)) - } else { - dirname := "" - dirents := []os.FileInfo{} - var err error = nil + } - dirname = f.Name() - dirents, err = f.Readdir(128) - if err != nil { - return svr.sendPacket(statusFromError(p.Id, err)) - } + dirname := f.Name() + dirents, err := f.Readdir(128) + if err != nil { + return svr.sendPacket(statusFromError(p.Id, err)) + } - ret := sshFxpNamePacket{p.Id, nil} - for _, dirent := range dirents { - ret.NameAttrs = append(ret.NameAttrs, sshFxpNameAttr{ - dirent.Name(), - runLs(dirname, dirent), - []interface{}{dirent}, - }) - } - return svr.sendPacket(ret) + ret := sshFxpNamePacket{Id: p.Id} + for _, dirent := range dirents { + ret.NameAttrs = append(ret.NameAttrs, sshFxpNameAttr{ + Name: dirent.Name(), + LongName: runLs(dirname, dirent), + Attrs: []interface{}{dirent}, + }) } + return svr.sendPacket(ret) } func (p sshFxpSetstatPacket) respond(svr *Server) error { if svr.readOnly { return svr.sendPacket(statusFromError(p.Id, syscall.EPERM)) - } else { - // additional unmarshalling is required for each possibility here - b := p.Attrs.([]byte) - var err error = nil - - debug("setstat name \"%s\"", p.Path) - if (p.Flags & ssh_FILEXFER_ATTR_SIZE) != 0 { - var size uint64 = 0 - if size, b, err = unmarshalUint64Safe(b); err == nil { - err = os.Truncate(p.Path, int64(size)) - } + } + + // additional unmarshalling is required for each possibility here + b := p.Attrs.([]byte) + var err error + + debug("setstat name \"%s\"", p.Path) + if (p.Flags & ssh_FILEXFER_ATTR_SIZE) != 0 { + var size uint64 + if size, b, err = unmarshalUint64Safe(b); err == nil { + err = os.Truncate(p.Path, int64(size)) } - if (p.Flags & ssh_FILEXFER_ATTR_PERMISSIONS) != 0 { - var mode uint32 = 0 - if mode, b, err = unmarshalUint32Safe(b); err == nil { - err = os.Chmod(p.Path, os.FileMode(mode)) - } + } + if (p.Flags & ssh_FILEXFER_ATTR_PERMISSIONS) != 0 { + var mode uint32 + if mode, b, err = unmarshalUint32Safe(b); err == nil { + err = os.Chmod(p.Path, os.FileMode(mode)) } - if (p.Flags & ssh_FILEXFER_ATTR_ACMODTIME) != 0 { - var atime uint32 = 0 - var mtime uint32 = 0 - if atime, b, err = unmarshalUint32Safe(b); err != nil { - } else if mtime, b, err = unmarshalUint32Safe(b); err != nil { - } else { - atimeT := time.Unix(int64(atime), 0) - mtimeT := time.Unix(int64(mtime), 0) - err = os.Chtimes(p.Path, atimeT, mtimeT) - } + } + if (p.Flags & ssh_FILEXFER_ATTR_ACMODTIME) != 0 { + var atime uint32 + var mtime uint32 + if atime, b, err = unmarshalUint32Safe(b); err != nil { + } else if mtime, b, err = unmarshalUint32Safe(b); err != nil { + } else { + atimeT := time.Unix(int64(atime), 0) + mtimeT := time.Unix(int64(mtime), 0) + err = os.Chtimes(p.Path, atimeT, mtimeT) } - if (p.Flags & ssh_FILEXFER_ATTR_UIDGID) != 0 { - var uid uint32 = 0 - var gid uint32 = 0 - if uid, b, err = unmarshalUint32Safe(b); err != nil { - } else if gid, b, err = unmarshalUint32Safe(b); err != nil { - } else { - err = os.Chown(p.Path, int(uid), int(gid)) - } + } + if (p.Flags & ssh_FILEXFER_ATTR_UIDGID) != 0 { + var uid uint32 + var gid uint32 + if uid, b, err = unmarshalUint32Safe(b); err != nil { + } else if gid, b, err = unmarshalUint32Safe(b); err != nil { + } else { + err = os.Chown(p.Path, int(uid), int(gid)) } - - return svr.sendPacket(statusFromError(p.Id, err)) } + + return svr.sendPacket(statusFromError(p.Id, err)) } func (p sshFxpFsetstatPacket) respond(svr *Server) error { if svr.readOnly { return svr.sendPacket(statusFromError(p.Id, syscall.EPERM)) - } else if f, ok := svr.getHandle(p.Handle); !ok { + } + + f, ok := svr.getHandle(p.Handle) + if !ok { return svr.sendPacket(statusFromError(p.Id, syscall.EBADF)) - } else { - // additional unmarshalling is required for each possibility here - b := p.Attrs.([]byte) - var err error = nil - - debug("fsetstat name \"%s\"", f.Name()) - if (p.Flags & ssh_FILEXFER_ATTR_SIZE) != 0 { - var size uint64 = 0 - if size, b, err = unmarshalUint64Safe(b); err == nil { - err = f.Truncate(int64(size)) - } + } + + // additional unmarshalling is required for each possibility here + b := p.Attrs.([]byte) + var err error + + debug("fsetstat name \"%s\"", f.Name()) + if (p.Flags & ssh_FILEXFER_ATTR_SIZE) != 0 { + var size uint64 + if size, b, err = unmarshalUint64Safe(b); err == nil { + err = f.Truncate(int64(size)) } - if (p.Flags & ssh_FILEXFER_ATTR_PERMISSIONS) != 0 { - var mode uint32 = 0 - if mode, b, err = unmarshalUint32Safe(b); err == nil { - err = f.Chmod(os.FileMode(mode)) - } + } + if (p.Flags & ssh_FILEXFER_ATTR_PERMISSIONS) != 0 { + var mode uint32 + if mode, b, err = unmarshalUint32Safe(b); err == nil { + err = f.Chmod(os.FileMode(mode)) } - if (p.Flags & ssh_FILEXFER_ATTR_ACMODTIME) != 0 { - var atime uint32 = 0 - var mtime uint32 = 0 - if atime, b, err = unmarshalUint32Safe(b); err != nil { - } else if mtime, b, err = unmarshalUint32Safe(b); err != nil { - } else { - atimeT := time.Unix(int64(atime), 0) - mtimeT := time.Unix(int64(mtime), 0) - err = os.Chtimes(f.Name(), atimeT, mtimeT) - } + } + if (p.Flags & ssh_FILEXFER_ATTR_ACMODTIME) != 0 { + var atime uint32 + var mtime uint32 + if atime, b, err = unmarshalUint32Safe(b); err != nil { + } else if mtime, b, err = unmarshalUint32Safe(b); err != nil { + } else { + atimeT := time.Unix(int64(atime), 0) + mtimeT := time.Unix(int64(mtime), 0) + err = os.Chtimes(f.Name(), atimeT, mtimeT) } - if (p.Flags & ssh_FILEXFER_ATTR_UIDGID) != 0 { - var uid uint32 = 0 - var gid uint32 = 0 - if uid, b, err = unmarshalUint32Safe(b); err != nil { - } else if gid, b, err = unmarshalUint32Safe(b); err != nil { - } else { - err = f.Chown(int(uid), int(gid)) - } + } + if (p.Flags & ssh_FILEXFER_ATTR_UIDGID) != 0 { + var uid uint32 + var gid uint32 + if uid, b, err = unmarshalUint32Safe(b); err != nil { + } else if gid, b, err = unmarshalUint32Safe(b); err != nil { + } else { + err = f.Chown(int(uid), int(gid)) } - - return svr.sendPacket(statusFromError(p.Id, err)) } + + return svr.sendPacket(statusFromError(p.Id, err)) } func errnoToSshErr(errno syscall.Errno) uint32 { - if errno == 0 { + switch errno { + case 0: return ssh_FX_OK - } else if errno == syscall.ENOENT { + case syscall.ENOENT: return ssh_FX_NO_SUCH_FILE - } else if errno == syscall.EPERM { + case syscall.EPERM: return ssh_FX_PERMISSION_DENIED - } else { - return ssh_FX_FAILURE } - return uint32(errno) + return ssh_FX_FAILURE } func statusFromError(id uint32, err error) sshFxpStatusPacket { @@ -542,8 +582,6 @@ func statusFromError(id uint32, err error) sshFxpStatusPacket { // ssh_FX_CONNECTION_LOST = 7 // ssh_FX_OP_UNSUPPORTED = 8 Code: ssh_FX_OK, - msg: "", - lang: "", }, } if err != nil { diff --git a/Godeps/_workspace/src/github.com/russross/blackfriday/block.go b/Godeps/_workspace/src/github.com/russross/blackfriday/block.go index 7fb472e..740ad46 100644 --- a/Godeps/_workspace/src/github.com/russross/blackfriday/block.go +++ b/Godeps/_workspace/src/github.com/russross/blackfriday/block.go @@ -1153,6 +1153,7 @@ gatherlines: // and move on to the next line if p.isEmpty(data[line:i]) > 0 { containsBlankLine = true + raw.Write(data[line:i]) line = i continue } @@ -1220,17 +1221,10 @@ gatherlines: // a blank line means this should be parsed as a block case containsBlankLine: - raw.WriteByte('\n') *flags |= LIST_ITEM_CONTAINS_BLOCK } - // if this line was preceeded by one or more blanks, - // re-introduce the blank into the buffer - if containsBlankLine { - containsBlankLine = false - raw.WriteByte('\n') - - } + containsBlankLine = false // add the line into the working buffer without prefix raw.Write(data[line+indent : i]) diff --git a/Godeps/_workspace/src/github.com/russross/blackfriday/block_test.go b/Godeps/_workspace/src/github.com/russross/blackfriday/block_test.go index 60da6ca..f59268e 100644 --- a/Godeps/_workspace/src/github.com/russross/blackfriday/block_test.go +++ b/Godeps/_workspace/src/github.com/russross/blackfriday/block_test.go @@ -702,10 +702,41 @@ func TestUnorderedList(t *testing.T) { "* List\n\n * sublist\n\n normal text\n\n * another sublist\n", "\n", + + `* Foo + + bar + + qux +`, + ` +`, } doTestsBlock(t, tests, 0) } +func TestFencedCodeBlockWithinList(t *testing.T) { + doTestsBlock(t, []string{ + "* Foo\n\n ```\n bar\n\n qux\n ```\n", + ` +`, + }, EXTENSION_FENCED_CODE) +} + func TestOrderedList(t *testing.T) { var tests = []string{ "1. Hello\n", @@ -798,6 +829,26 @@ func TestOrderedList(t *testing.T) { "1. numbers\n1. are ignored\n", "
    \n
  1. numbers
  2. \n
  3. are ignored
  4. \n
\n", + + `1. Foo + + bar + + + + qux +`, + `
    +
  1. Foo

    + +
    bar
    +
    +
    +
    +qux
    +
  2. +
+`, } doTestsBlock(t, tests, 0) } diff --git a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go b/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go index 848da9c..01c874d 100644 --- a/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go +++ b/Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go @@ -235,9 +235,9 @@ func postscript(out *bytes.Buffer, name string) { `, name) fmt.Fprintf(out, `if [[ $(type -t compopt) = "builtin" ]]; then - complete -F __start_%s %s + complete -o default -F __start_%s %s else - complete -o nospace -F __start_%s %s + complete -o default -o nospace -F __start_%s %s fi `, name, name, name, name) diff --git a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go b/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go index c7bbec9..e7abe01 100644 --- a/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go +++ b/Godeps/_workspace/src/github.com/spf13/jwalterweatherman/thatswhyyoualwaysleaveanote.go @@ -65,6 +65,13 @@ var ( fatal *NotePad = &NotePad{Level: LevelFatal, Handle: os.Stdout, Logger: &FATAL, Prefix: "FATAL: "} logThreshold Level = DefaultLogThreshold outputThreshold Level = DefaultStdoutThreshold + + DATE = log.Ldate + TIME = log.Ltime + SFILE = log.Lshortfile + LFILE = log.Llongfile + MSEC = log.Lmicroseconds + logFlags = DATE | TIME | SFILE ) func init() { @@ -91,12 +98,17 @@ func initialize() { } for _, n := range NotePads { - *n.Logger = log.New(n.Handle, n.Prefix, log.Ldate) + *n.Logger = log.New(n.Handle, n.Prefix, logFlags) } LOG = log.New(LogHandle, "LOG: ", - log.Ldate|log.Ltime|log.Lshortfile) + logFlags) +} + +// Set the log Flags (Available flag: DATE, TIME, SFILE, LFILE and MSEC) +func SetLogFlag(flags int) { + logFlags = flags } // Level returns the current global log threshold. @@ -171,14 +183,16 @@ func DiscardLogging() { // logging with the standard extra information (date, file, etc) // Only Println and Printf are currently provided for this func (fb *Feedback) Println(v ...interface{}) { - fmt.Println(v...) - LOG.Println(v...) + s := fmt.Sprintln(v...) + fmt.Print(s) + LOG.Output(2, s) } // Feedback is special. It writes plainly to the output while // logging with the standard extra information (date, file, etc) // Only Println and Printf are currently provided for this func (fb *Feedback) Printf(format string, v ...interface{}) { - fmt.Printf(format, v...) - LOG.Printf(format, v...) + s := fmt.Sprintf(format, v...) + fmt.Print(s) + LOG.Output(2, s) } diff --git a/Godeps/_workspace/src/github.com/spf13/viper/viper.go b/Godeps/_workspace/src/github.com/spf13/viper/viper.go index 4a5b1eb..389a58e 100644 --- a/Godeps/_workspace/src/github.com/spf13/viper/viper.go +++ b/Godeps/_workspace/src/github.com/spf13/viper/viper.go @@ -526,13 +526,14 @@ func (v *Viper) Get(key string) interface{} { // Returns new Viper instance representing a sub tree of this instance func Sub(key string) *Viper { return v.Sub(key) } func (v *Viper) Sub(key string) *Viper { - data, ok := v.Get(key).(map[string]interface{}) - if !ok { + subv := New() + data := v.Get(key) + if reflect.TypeOf(data).Kind() == reflect.Map { + subv.config = cast.ToStringMap(data) + return subv + } else { return nil } - subv := New() - subv.config = data - return subv } // Returns the value associated with the key as a string diff --git a/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go b/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go index e9bb3f4..fcb9c4e 100644 --- a/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go +++ b/Godeps/_workspace/src/github.com/spf13/viper/viper_test.go @@ -730,7 +730,10 @@ func TestSub(t *testing.T) { v.SetConfigType("yaml") v.ReadConfig(bytes.NewBuffer(yamlExample)) - subv := v.Sub("clothing.pants") + subv := v.Sub("clothing") + assert.Equal(t, v.Get("clothing.pants.size"), subv.Get("pants.size")) + + subv = v.Sub("clothing.pants") assert.Equal(t, v.Get("clothing.pants.size"), subv.Get("size")) subv = v.Sub("clothing.pants.size") diff --git a/documentation/man/corectl-kill.1 b/documentation/man/corectl-kill.1 index c3f7eb5..6faad27 100644 --- a/documentation/man/corectl-kill.1 +++ b/documentation/man/corectl-kill.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-load.1 b/documentation/man/corectl-load.1 index c9de29b..f9aebfa 100644 --- a/documentation/man/corectl-load.1 +++ b/documentation/man/corectl-load.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-ls.1 b/documentation/man/corectl-ls.1 index dece4ca..7cff592 100644 --- a/documentation/man/corectl-ls.1 +++ b/documentation/man/corectl-ls.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-ps.1 b/documentation/man/corectl-ps.1 index 832ae66..ad81eb5 100644 --- a/documentation/man/corectl-ps.1 +++ b/documentation/man/corectl-ps.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-pull.1 b/documentation/man/corectl-pull.1 index 9b07631..a3421bd 100644 --- a/documentation/man/corectl-pull.1 +++ b/documentation/man/corectl-pull.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-put.1 b/documentation/man/corectl-put.1 index 23c0cd8..f080f79 100644 --- a/documentation/man/corectl-put.1 +++ b/documentation/man/corectl-put.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-query.1 b/documentation/man/corectl-query.1 index cdaa7a1..5b05327 100644 --- a/documentation/man/corectl-query.1 +++ b/documentation/man/corectl-query.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-rm.1 b/documentation/man/corectl-rm.1 index 55e9492..1dd8c9b 100644 --- a/documentation/man/corectl-rm.1 +++ b/documentation/man/corectl-rm.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-run.1 b/documentation/man/corectl-run.1 index 528408b..2a23cc6 100644 --- a/documentation/man/corectl-run.1 +++ b/documentation/man/corectl-run.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-ssh.1 b/documentation/man/corectl-ssh.1 index 3cd0e9c..2358c71 100644 --- a/documentation/man/corectl-ssh.1 +++ b/documentation/man/corectl-ssh.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl-version.1 b/documentation/man/corectl-version.1 index 673e1ae..6fb0a78 100644 --- a/documentation/man/corectl-version.1 +++ b/documentation/man/corectl-version.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME diff --git a/documentation/man/corectl.1 b/documentation/man/corectl.1 index a13fb65..6bc95ee 100644 --- a/documentation/man/corectl.1 +++ b/documentation/man/corectl.1 @@ -1,4 +1,6 @@ -.TH "corectl" "1" "" " " "" "" +.TH "corectl" "1" "" " " "" +.nh +.ad l .SH NAME