From: "Desimone, Ashley E" <ashley.e.desimone@intel.com>
To: devel@edk2.groups.io
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>,
Puja Pandya <puja.pandya@intel.com>
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 [thread overview]
Message-ID: <20191106223944.18036-7-ashley.e.desimone@intel.com> (raw)
In-Reply-To: <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 <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
---
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.<BR>
+# 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
next prev parent reply other threads:[~2019-11-06 22:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 22:39 [edk2-devel][edk2-staging/EdkRepo][PATCH v2 1/8] EdkRepo: Argument String Refactor - Removed Unused Strings Desimone, Ashley E
2019-11-06 22:39 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 2/8] EdkRepo: Argument String Refactor Manifest Command Desimone, Ashley E
2019-11-06 22:44 ` Nate DeSimone
2019-11-06 22:39 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 3/8] EdkRepo: Argument String Refactor - Combo Command Desimone, Ashley E
2019-11-06 22:44 ` Nate DeSimone
2019-11-06 22:39 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 4/8] EdkRepo: Argument String Refactor - Checkout Command Desimone, Ashley E
2019-11-06 22:44 ` Nate DeSimone
2019-11-06 22:39 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 5/8] EdkRepo: Argument Strings Refactor - Sparse Command Desimone, Ashley E
2019-11-06 22:44 ` Nate DeSimone
2019-11-06 22:39 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 6/8] EdkRepo: Argument Strings Refactor - Sync Command Desimone, Ashley E
2019-11-06 22:44 ` Nate DeSimone
2019-11-06 22:39 ` Desimone, Ashley E [this message]
2019-11-06 22:44 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 7/8] EdkRepo: Argument Strings Refactor - Clone Command Nate DeSimone
2019-11-06 22:39 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 8/8] EdkRepo: Argument Strings Refactor - EdkRepo Command Desimone, Ashley E
2019-11-06 22:44 ` Nate DeSimone
2019-11-06 22:44 ` [edk2-devel][edk2-staging/EdkRepo][PATCH v2 1/8] EdkRepo: Argument String Refactor - Removed Unused Strings Nate DeSimone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191106223944.18036-7-ashley.e.desimone@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox