From 78d5490be891105a1664328f780bcac27fcbc8c4 Mon Sep 17 00:00:00 2001
From: Andrew Davison <andrew.davison@unic.cnrs-gif.fr>
Date: Sun, 10 Sep 2017 13:45:46 +0200
Subject: [PATCH] rename `smt script` to `smt view`

cf #364 and #342
---
 sumatra/commands.py | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/sumatra/commands.py b/sumatra/commands.py
index 931d5824..7486fae5 100644
--- a/sumatra/commands.py
+++ b/sumatra/commands.py
@@ -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):