Skip to content

Commit

Permalink
rename smt script to smt view
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Sep 10, 2017
1 parent 0ce2c2e commit 525e7bb
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions sumatra/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

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

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."

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


def script(argv):
"""Print script content of the recording label."""
usage = "%(prog)s script"
description = "Print script content of the recording label."
def view(argv):
"""View detail of a single record."""
usage = "%(prog)s view"
description = "View detail of a single record."
parser = ArgumentParser(usage=usage,
description=description)
parser.add_argument('label')
parser.add_argument('-s', '--script', help="show script content.")
parser.add_argument('-v', '--version', help="show version of main script.")
args = parser.parse_args(argv)
project = load_project()
record = project.get_record(args.label)
print('Main_File\t :',record.main_file)
print('Version\t\t :',record.version)
print(80*'-')
print(record.script_content)
print(80*'-')
if args.version:
print('Version\t\t :',record.version)
print(80*'-')
if args.script:
print(record.script_content)
print(80*'-')
# implementation to finish, including other record fields as options
# todo: use `formatting` module, rather than print statements


def version(argv):
Expand Down

0 comments on commit 525e7bb

Please sign in to comment.