diff options
author | baude <bbaude@redhat.com> | 2017-12-04 10:24:08 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-12-04 20:03:16 +0000 |
commit | 265efcb9f88a78ee52eb5644d4db86e49788991f (patch) | |
tree | cf0d95609547408a30bcad558829701b344fc787 /vendor/github.com/urfave/cli/sort.go | |
parent | 750fc239b5da8e3f2792ae33f46a671ddf4622e3 (diff) | |
download | podman-265efcb9f88a78ee52eb5644d4db86e49788991f.tar.gz podman-265efcb9f88a78ee52eb5644d4db86e49788991f.tar.bz2 podman-265efcb9f88a78ee52eb5644d4db86e49788991f.zip |
Vendor in latest urfave/cli
The latest urfave/cli has the ability for us
to use short options when it is a bool.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #100
Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/urfave/cli/sort.go')
-rw-r--r-- | vendor/github.com/urfave/cli/sort.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/github.com/urfave/cli/sort.go b/vendor/github.com/urfave/cli/sort.go new file mode 100644 index 000000000..23d1c2f77 --- /dev/null +++ b/vendor/github.com/urfave/cli/sort.go @@ -0,0 +1,29 @@ +package cli + +import "unicode" + +// lexicographicLess compares strings alphabetically considering case. +func lexicographicLess(i, j string) bool { + iRunes := []rune(i) + jRunes := []rune(j) + + lenShared := len(iRunes) + if lenShared > len(jRunes) { + lenShared = len(jRunes) + } + + for index := 0; index < lenShared; index++ { + ir := iRunes[index] + jr := jRunes[index] + + if lir, ljr := unicode.ToLower(ir), unicode.ToLower(jr); lir != ljr { + return lir < ljr + } + + if ir != jr { + return ir < jr + } + } + + return i < j +} |