Skip to content

Commit 525e7bb

Browse files
committed
rename smt script to smt view
cf #364 and #342
1 parent 0ce2c2e commit 525e7bb

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

sumatra/commands.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
modes = ("init", "configure", "info", "run", "list", "delete", "comment", "tag",
4242
"repeat", "diff", "help", "export", "upgrade", "sync", "migrate", "version",
43-
"script")
43+
"view")
4444

4545
store_arg_help = "The argument can take the following forms: (1) `/path/to/sqlitedb` - DjangoRecordStore is used with the specified Sqlite database, (2) `http[s]://location` - remote HTTPRecordStore is used with a remote Sumatra server, (3) `postgres://username:password@hostname/databasename` - DjangoRecordStore is used with specified Postgres database."
4646

@@ -759,21 +759,27 @@ def migrate(argv):
759759
# should we also change the default values stored in the Project?
760760

761761

762-
def script(argv):
763-
"""Print script content of the recording label."""
764-
usage = "%(prog)s script"
765-
description = "Print script content of the recording label."
762+
def view(argv):
763+
"""View detail of a single record."""
764+
usage = "%(prog)s view"
765+
description = "View detail of a single record."
766766
parser = ArgumentParser(usage=usage,
767767
description=description)
768768
parser.add_argument('label')
769+
parser.add_argument('-s', '--script', help="show script content.")
770+
parser.add_argument('-v', '--version', help="show version of main script.")
769771
args = parser.parse_args(argv)
770772
project = load_project()
771773
record = project.get_record(args.label)
772774
print('Main_File\t :',record.main_file)
773-
print('Version\t\t :',record.version)
774-
print(80*'-')
775-
print(record.script_content)
776-
print(80*'-')
775+
if args.version:
776+
print('Version\t\t :',record.version)
777+
print(80*'-')
778+
if args.script:
779+
print(record.script_content)
780+
print(80*'-')
781+
# implementation to finish, including other record fields as options
782+
# todo: use `formatting` module, rather than print statements
777783

778784

779785
def version(argv):

0 commit comments

Comments
 (0)