From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com []) by mx.groups.io with SMTP id smtpd.web10.83.1573079992831490407 for ; Wed, 06 Nov 2019 14:39:53 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: ashley.e.desimone@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 14:39:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,275,1569308400"; d="scan'208";a="205481890" Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga003.jf.intel.com with ESMTP; 06 Nov 2019 14:39:51 -0800 From: "Desimone, Ashley E" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya Subject: [edk2-devel][edk2-staging/EdkRepo][PATCH v2 7/8] EdkRepo: Argument Strings Refactor - Clone Command Date: Wed, 6 Nov 2019 14:39:43 -0800 Message-Id: <20191106223944.18036-7-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20191106223944.18036-1-ashley.e.desimone@intel.com> References: <20191106223944.18036-1-ashley.e.desimone@intel.com> Move all argument strings for clone_command.py to edkrepo/commands/arguments/clone_args.py Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya --- edkrepo/commands/arguments/clone_args.py | 22 ++++++++++++++++++++++ edkrepo/commands/clone_command.py | 24 +++++++----------------- edkrepo/common/argument_strings.py | 14 -------------- 3 files changed, 29 insertions(+), 31 deletions(-) create mode 100644 edkrepo/commands/arguments/clone_args.py diff --git a/edkrepo/commands/arguments/clone_args.py b/edkrepo/commands/arguments/clone_args.py new file mode 100644 index 0000000..b143adc --- /dev/null +++ b/edkrepo/commands/arguments/clone_args.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +# +## @file +# clone_args.py +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +''' Contains the help and description strings for arguments in the +clone command meta data. +''' + +COMMAND_DESCRIPTION = 'Downloads a project and creates a new workspace.' +WORKSPACE_HELP = ('The destination for the newly created workspace, this must be an empty directory.\n' + 'A value of "." indicates the current working directory.') +PROJECT_MANIFEST_HELP = ('Either a project name as listed by "edkrepo manifest" or the path to a project manifest file.\n' + 'If a relative path is provided clone will first search relative to the current working directory' + ' and then search relative to the global manifest repository.') +COMBINATION_HELP = 'The name of the combination to checkout. If not specified the projects default combination is used.' +SPARSE_HELP = 'Enables sparse checkout if supported by the project manifest file.' +NO_SPARSE_HELP = 'Disables sparse checkout if the project manifest file enables it by default.' \ No newline at end of file diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_command.py index e74c4e4..2400272 100644 --- a/edkrepo/commands/clone_command.py +++ b/edkrepo/commands/clone_command.py @@ -10,14 +10,9 @@ import os import shutil - -# Our modules from edkrepo.commands.edkrepo_command import EdkrepoCommand from edkrepo.commands.edkrepo_command import SubmoduleSkipArgument -from edkrepo.common.argument_strings import PROJECT_OR_MANIFEST_DESCRIPTION, PROJECT_OR_MANIFEST_HELP -from edkrepo.common.argument_strings import COMBINATION_DESCRIPTION, COMBINATION_HELP, WORKSPACE_DESCRIPTION -from edkrepo.common.argument_strings import WORKSPACE_HELP, CLONE_COMMAND_DESCRIPTION -from edkrepo.common.argument_strings import SPARSE_HELP, SPARSE_DESCRIPTION, NO_SPARSE_DESCRIPTION, NO_SPARSE_HELP +import edkrepo.commands.arguments.clone_args as arguments from edkrepo.common.common_repo_functions import pull_latest_manifest_repo, clone_repos, sparse_checkout, verify_manifest_data from edkrepo.common.common_repo_functions import case_insensitive_single_match, update_editor_config from edkrepo.common.common_repo_functions import write_included_config, write_conditional_include @@ -35,37 +30,32 @@ class CloneCommand(EdkrepoCommand): def get_metadata(self): metadata = {} metadata['name'] = 'clone' - metadata['help-text'] = CLONE_COMMAND_DESCRIPTION + metadata['help-text'] = arguments.COMMAND_DESCRIPTION args = [] metadata['arguments'] = args args.append({'name': 'Workspace', 'positional': True, 'position': 0, 'required': True, - 'description': WORKSPACE_DESCRIPTION, - 'help-text': WORKSPACE_HELP}) + 'help-text': arguments.WORKSPACE_HELP}) args.append({'name': 'ProjectNameOrManifestFile', 'positional': True, 'position': 1, 'required': True, - 'description': PROJECT_OR_MANIFEST_DESCRIPTION, - 'help-text': PROJECT_OR_MANIFEST_HELP}) + 'help-text': arguments.PROJECT_MANIFEST_HELP}) args.append({'name': 'Combination', 'positional': True, 'position': 2, 'required': False, - 'description': COMBINATION_DESCRIPTION, - 'help-text': COMBINATION_HELP}) + 'help-text': arguments.COMBINATION_HELP}) args.append({'name': 'sparse', 'positional': False, 'required': False, - 'description': SPARSE_DESCRIPTION, - 'help-text': SPARSE_HELP}) + 'help-text': arguments.SPARSE_HELP}) args.append({'name': 'nosparse', 'positional': False, 'required': False, - 'description': NO_SPARSE_DESCRIPTION, - 'help-text': NO_SPARSE_HELP}) + 'help-text': arguments.NO_SPARSE_HELP}) args.append(SubmoduleSkipArgument) return metadata diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py index b001441..75e13ee 100644 --- a/edkrepo/common/argument_strings.py +++ b/edkrepo/common/argument_strings.py @@ -18,18 +18,4 @@ OVERRIDE_HELP = 'Ignore warnings' SUBMODULE_SKIP_HELP = 'Skip the pull or sync of any submodules.' COLOR_HELP = 'Force color output (useful with \'less -r\')' -#Args for clone_command.py -CLONE_COMMAND_DESCRIPTION = 'Downloads a project and creates a new workspace' -WORKSPACE_DESCRIPTION = 'The workspace in which to clone.' -WORKSPACE_HELP = 'The workspace in which to clone. This must refer to an empty directory. A value of "." indicates the current working directory \n' -PROJECT_OR_MANIFEST_DESCRIPTION = 'The project name as listed in the CiIndex.xml file or the name of the manifest file' -PROJECT_OR_MANIFEST_HELP = ('The project name as listed in the CiIndex.xml file or a path to a manifest file. If a relative path to a manifest file is provided ' + - 'clone will attempt to find it by first searching relative to the current working directory and then searchting relative to the ' + - 'global manifest repository \n') -COMBINATION_DESCRIPTION = 'The combination to checkout' -COMBINATION_HELP = 'The combination name to checkout if not specified the default combination is used.\n' -SPARSE_DESCRIPTION = 'Enables sparse checkout support.' -SPARSE_HELP = 'Enables a sparse checkout based on the contents of the DSC file(s) listed by the manifest.\n' -NO_SPARSE_DESCRIPTION = 'Disables sparse checkout support.' -NO_SPARSE_HELP = 'Disables sparse checkout if enabled by default in the manifest.\n' -- 2.16.2.windows.1