diff src/entai_app/entai_app.go @ 7:f4ba4cfb09fd

entai_app: abbreviration paid date.
author pyon@macmini
date Fri, 28 Oct 2016 20:41:34 +0900
parents e4066309b04f
children
line wrap: on
line diff
--- a/src/entai_app/entai_app.go	Thu Oct 27 20:42:11 2016 +0900
+++ b/src/entai_app/entai_app.go	Fri Oct 28 20:41:34 2016 +0900
@@ -1,6 +1,6 @@
 /****************************************************************************/
 /* Entai_app.go                                                             */
-/*                                    Last Change: 2016-10-23 Sun 13:23:32. */
+/*                                    Last Change: 2016-10-28 Fri 19:33:15. */
 /*                                    By T.Mutoh                            */
 /****************************************************************************/
 
@@ -133,11 +133,17 @@
 
     // 1-Liner-mode
     case *l :
-        if *i {
-            fmt.Printf( "%s,%s,%s,", flag.Arg(0), flag.Arg(1), flag.Arg(2) )
+        p := flag.Arg(2)
+        if p == "" {
+            layout := "20060102"
+            p = time.Now().Format( layout );
         }
 
-		result, detail, err := processEntai( flag.Arg(0), flag.Arg(1), flag.Arg(2) )
+        if *i {
+            fmt.Printf( "%s,%s,%s,", flag.Arg(0), flag.Arg(1), p )
+        }
+
+		result, detail, err := processEntai( flag.Arg(0), flag.Arg(1), p )
         if err != nil {
 			fmt.Fprintf( os.Stderr, "%s : %v\n", detail, err )
 			os.Exit( 1 )