Skip to content

Commit ab117b7

Browse files
committed
improve help for add to show sif_path and module_id to close #369
Signed-off-by: vsoch <[email protected]>
1 parent c8f9c99 commit ab117b7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

shpc/client/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ def get_parser():
102102

103103
# Add a container direcly
104104
add = subparsers.add_parser("add", help="add an image to local storage")
105-
add.add_argument("paths", help="full path to container image file", nargs=2)
105+
add.add_argument("sif_path", help="full path to container image file", nargs=1)
106+
add.add_argument(
107+
"module_id", help='desired identifier for module (e.g. "name/version")', nargs=1
108+
)
106109

107110
check = subparsers.add_parser("check", help="check if you have latest installed.")
108111
check.add_argument("module_name", help="module to check (module/version)")

shpc/client/add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def main(args, parser, extra, subparser):
1313
module=args.module,
1414
container_tech=args.container_tech,
1515
)
16-
cli.add(args.paths[0], args.paths[1])
16+
cli.add(args.sif_path[0], args.module_id[0])

shpc/main/modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def add(self, sif, module_name):
157157
dest = os.path.join(container_dir, "%s-sha256:%s.sif" % (name, digest))
158158
shutil.copyfile(sif, dest)
159159
self._install(module_dir, dest, name)
160+
self._add_environment(module_dir, {})
160161
logger.info("Module %s was created." % (module_name))
161162

162163
def get(self, module_name):

0 commit comments

Comments
 (0)