Merge "Add short arguments and fix small errors"
This commit is contained in:
@@ -54,26 +54,28 @@ class ListArtifacts(command.Lister):
|
|||||||
help='Name of artifact type.',
|
help='Name of artifact type.',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--limit',
|
'--limit', '-l',
|
||||||
default=20,
|
default=20,
|
||||||
metavar='<LIMIT>',
|
metavar='<LIMIT>',
|
||||||
|
type=int,
|
||||||
help='Maximum number of artifacts to get.',
|
help='Maximum number of artifacts to get.',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--page-size',
|
'--page-size', '-p',
|
||||||
default=20,
|
default=20,
|
||||||
metavar='<SIZE>',
|
metavar='<SIZE>',
|
||||||
|
type=int,
|
||||||
help='Number of artifacts to request in each paginated request.',
|
help='Number of artifacts to request in each paginated request.',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--filter',
|
'--filter', '-F',
|
||||||
default=[],
|
default=[],
|
||||||
action='append',
|
action='append',
|
||||||
metavar='<KEY=VALUE>',
|
metavar='<KEY=VALUE>',
|
||||||
help='Filtering artifact list by a user-defined property.',
|
help='Filtering artifact list by a user-defined property.',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--sort',
|
'--sort', '-s',
|
||||||
default='name:asc',
|
default='name:asc',
|
||||||
metavar='<key>[:<direction>]',
|
metavar='<key>[:<direction>]',
|
||||||
help='Comma-separated list of sort keys and directions in the '
|
help='Comma-separated list of sort keys and directions in the '
|
||||||
@@ -149,13 +151,13 @@ class CreateArtifact(command.Lister):
|
|||||||
help='Name of the artifact.',
|
help='Name of the artifact.',
|
||||||
),
|
),
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--artifact-version',
|
'--artifact-version', '-v',
|
||||||
default='0.0.0',
|
default='0.0.0',
|
||||||
metavar='<VERSION>',
|
metavar='<VERSION>',
|
||||||
help='Version of the artifact.',
|
help='Version of the artifact.',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--property',
|
'--property', '-p',
|
||||||
metavar='<key=value>',
|
metavar='<key=value>',
|
||||||
action='append',
|
action='append',
|
||||||
default=[],
|
default=[],
|
||||||
@@ -196,19 +198,19 @@ class UpdateArtifact(command.Lister):
|
|||||||
help='ID of the artifact to update.',
|
help='ID of the artifact to update.',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--name',
|
'--name', '-n',
|
||||||
metavar='<NAME>',
|
metavar='<NAME>',
|
||||||
help='Name of the artifact.',
|
help='Name of the artifact.',
|
||||||
),
|
),
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--remove-property',
|
'--remove-property', '-r',
|
||||||
metavar='<key>',
|
metavar='<key>',
|
||||||
action='append',
|
action='append',
|
||||||
default=[],
|
default=[],
|
||||||
help='Property that will be removed.'
|
help='Property that will be removed.'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--property',
|
'--property', '-p',
|
||||||
metavar='<key=value>',
|
metavar='<key=value>',
|
||||||
action='append',
|
action='append',
|
||||||
default=[],
|
default=[],
|
||||||
|
@@ -58,7 +58,7 @@ class UploadBlob(command.ShowOne):
|
|||||||
help='Local file that contains data to be uploaded.',
|
help='Local file that contains data to be uploaded.',
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--blob-property',
|
'--blob-property', '-p',
|
||||||
metavar='<BLOB_PROPERTY>',
|
metavar='<BLOB_PROPERTY>',
|
||||||
help='Name of the blob field.'
|
help='Name of the blob field.'
|
||||||
)
|
)
|
||||||
@@ -70,6 +70,7 @@ class UploadBlob(command.ShowOne):
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--progress',
|
'--progress',
|
||||||
|
action='store_true',
|
||||||
help='Show download progress bar.'
|
help='Show download progress bar.'
|
||||||
)
|
)
|
||||||
return parser
|
return parser
|
||||||
@@ -119,7 +120,7 @@ class DownloadBlob(command.Command):
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--progress',
|
'--progress',
|
||||||
default=False,
|
action='store_true',
|
||||||
help='Show download progress bar.'
|
help='Show download progress bar.'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@@ -130,7 +131,7 @@ class DownloadBlob(command.Command):
|
|||||||
'the blob will not be saved.'
|
'the blob will not be saved.'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--blob-property',
|
'--blob-property', '-p',
|
||||||
metavar='<BLOB_PROPERTY>',
|
metavar='<BLOB_PROPERTY>',
|
||||||
default=None,
|
default=None,
|
||||||
help='Name of the blob field.'
|
help='Name of the blob field.'
|
||||||
|
@@ -82,8 +82,8 @@ class TestListArtifacts(TestArtifacts):
|
|||||||
self.check_parser(self.cmd, arglist, verify)
|
self.check_parser(self.cmd, arglist, verify)
|
||||||
|
|
||||||
def test_artifact_list_with_sort(self):
|
def test_artifact_list_with_sort(self):
|
||||||
arglist = ['images', '--sort', 'name:asc']
|
arglist = ['sample_artifact', '--sort', 'name:asc']
|
||||||
verify = [('type_name', 'images'),
|
verify = [('type_name', 'sample_artifact'),
|
||||||
('sort', 'name:asc')]
|
('sort', 'name:asc')]
|
||||||
|
|
||||||
self.check_parser(self.cmd, arglist, verify)
|
self.check_parser(self.cmd, arglist, verify)
|
||||||
@@ -99,19 +99,19 @@ class TestListArtifacts(TestArtifacts):
|
|||||||
def test_artifact_list_page_size(self):
|
def test_artifact_list_page_size(self):
|
||||||
arglist = ['images', '--page-size', '1']
|
arglist = ['images', '--page-size', '1']
|
||||||
verify = [('type_name', 'images'),
|
verify = [('type_name', 'images'),
|
||||||
('page_size', '1')]
|
('page_size', 1)]
|
||||||
self.check_parser(self.cmd, arglist, verify)
|
self.check_parser(self.cmd, arglist, verify)
|
||||||
|
|
||||||
def test_artifact_list_limit(self):
|
def test_artifact_list_limit(self):
|
||||||
arglist = ['images', '--limit', '2']
|
arglist = ['images', '--limit', '2']
|
||||||
verify = [('type_name', 'images'),
|
verify = [('type_name', 'images'),
|
||||||
('limit', '2')]
|
('limit', 2)]
|
||||||
self.check_parser(self.cmd, arglist, verify)
|
self.check_parser(self.cmd, arglist, verify)
|
||||||
|
|
||||||
def test_artifact_list_multilimit(self):
|
def test_artifact_list_multilimit(self):
|
||||||
arglist = ['images', '--limit', '2', '--limit', '1']
|
arglist = ['images', '--limit', '2', '--limit', '1']
|
||||||
verify = [('type_name', 'images'),
|
verify = [('type_name', 'images'),
|
||||||
('limit', '1')]
|
('limit', 1)]
|
||||||
self.check_parser(self.cmd, arglist, verify)
|
self.check_parser(self.cmd, arglist, verify)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -231,7 +231,7 @@ class TestDownloadBlob(TestBlobs):
|
|||||||
arglist = ['images',
|
arglist = ['images',
|
||||||
'fc15c365-d4f9-4b8b-a090-d9e230f1f6ba',
|
'fc15c365-d4f9-4b8b-a090-d9e230f1f6ba',
|
||||||
'--file', '/path/to/file',
|
'--file', '/path/to/file',
|
||||||
'--progress', 'True']
|
'--progress']
|
||||||
verify = [('type_name', 'images')]
|
verify = [('type_name', 'images')]
|
||||||
|
|
||||||
parsed_args = self.check_parser(self.cmd, arglist, verify)
|
parsed_args = self.check_parser(self.cmd, arglist, verify)
|
||||||
|
Reference in New Issue
Block a user