Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Michio Honda committed Nov 25, 2024
1 parent 708da7e commit 9886310
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tm.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,24 +528,25 @@ def filesystem(self, argv):
dst = 'dst'
fslst = []
fp = Path(self.filesystems)
fpname = 'name in {}'.format(fp/u)
for cmd in ('clone', 'new', 'delete', 'archive', 'restore'):
p = subparsers.add_parser(cmd,
usage='tm filesystem {}'.format(cmd))
if cmd in ('new', 'clone', 'delete', 'archive', 'restore'):
if cmd == 'restore':
h = 'archived filesystem path (.tar.gz)'
h = 'absolute path of the filesystem tarball (.tar.gz)'
elif cmd == 'new':
h = 'image in {}: '.format(fp/'base')
fslst = [str(x.name) for x in (fp/'base').iterdir()
if re.search('.tar.gz$', str(x))]
h += ' '.join(fslst)
else:
h = 'name in {}'.format(fp/u)
h = fpname
p.add_argument(src, type=str, help=h)
p.usage += ' {}'.format(src)

if cmd in ('new', 'clone', 'restore'):
p.add_argument(dst, type=str, help='name in {}'.format(fp/u))
p.add_argument(dst, type=str, help=fpname)
p.usage += ' {}'.format(dst)

p.usage += ' {}'.format('[-h|--help]')
Expand Down

0 comments on commit 9886310

Please sign in to comment.