|
40 | 40 |
|
41 | 41 | modes = ("init", "configure", "info", "run", "list", "delete", "comment", "tag", |
42 | 42 | "repeat", "diff", "help", "export", "upgrade", "sync", "migrate", "version", |
43 | | - "script") |
| 43 | + "view") |
44 | 44 |
|
45 | 45 | 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." |
46 | 46 |
|
@@ -759,21 +759,27 @@ def migrate(argv): |
759 | 759 | # should we also change the default values stored in the Project? |
760 | 760 |
|
761 | 761 |
|
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." |
766 | 766 | parser = ArgumentParser(usage=usage, |
767 | 767 | description=description) |
768 | 768 | 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.") |
769 | 771 | args = parser.parse_args(argv) |
770 | 772 | project = load_project() |
771 | 773 | record = project.get_record(args.label) |
772 | 774 | 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 |
777 | 783 |
|
778 | 784 |
|
779 | 785 | def version(argv): |
|
0 commit comments