diff --git a/command/flag/megabytes.go b/command/flag/megabytes.go index fba36da4951..edb780c9b7d 100644 --- a/command/flag/megabytes.go +++ b/command/flag/megabytes.go @@ -10,7 +10,7 @@ import ( ) const ( - AllowedUnits = "mg" + AllowedUnits = "mgt" ) type Megabytes struct { diff --git a/command/flag/megabytes_test.go b/command/flag/megabytes_test.go index c790976923e..385efc921f4 100644 --- a/command/flag/megabytes_test.go +++ b/command/flag/megabytes_test.go @@ -47,6 +47,22 @@ var _ = Describe("Megabytes", func() { }) }) + When("the suffix is T", func() { + It("interprets the number as terabytes", func() { + err := megabytes.UnmarshalFlag("2T") + Expect(err).ToNot(HaveOccurred()) + Expect(megabytes.Value).To(BeEquivalentTo(2097152)) + }) + }) + + When("the suffix is TB", func() { + It("interprets the number as terabytes", func() { + err := megabytes.UnmarshalFlag("3TB") + Expect(err).ToNot(HaveOccurred()) + Expect(megabytes.Value).To(BeEquivalentTo(3145728)) + }) + }) + When("the suffix is lowercase", func() { It("is case insensitive", func() { err := megabytes.UnmarshalFlag("7m")