felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1736045 - /felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java
Date Mon, 21 Mar 2016 16:58:38 GMT
Author: gnodet
Date: Mon Mar 21 16:58:38 2016
New Revision: 1736045

URL: http://svn.apache.org/viewvc?rev=1736045&view=rev
Log:
Remove unsupported date options

Modified:
    felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java

Modified: felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java?rev=1736045&r1=1736044&r2=1736045&view=diff
==============================================================================
--- felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java (original)
+++ felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java Mon Mar 21
16:58:38 2016
@@ -215,24 +215,18 @@ public class Posix {
     protected void date(CommandSession session, String[] argv) throws Exception {
         String[] usage = {
                 "date -  display date",
-                "Usage: date [-u] [-r seconds] [-v[+|-]val[mwdHMS] ...] [-f input_fmt new_date]
[+output_fmt]",
+                "Usage: date [-r seconds] [-v[+|-]val[mwdHMS] ...] [-f input_fmt new_date]
[+output_fmt]",
                 "  -? --help                    Show help",
                 "  -u                           Use UTC",
                 "  -r                           Print the date represented by 'seconds' since
January 1, 1970",
-                "  -v                           Adjust date",
                 "  -f                           Use 'input_fmt' to parse 'new_date'"
         };
-        boolean utc = false; // TODO: handle UTC
         Date input = new Date();
         String output = null;
-        List<String> adjs = new ArrayList<>();
         for (int i = 1; i < argv.length; i++) {
             if ("-?".equals(argv[i]) || "--help".equals(argv[i])) {
                 throw new HelpException(String.join("\n", usage));
             }
-            else if ("-u".equals(argv[i])) {
-                utc = true;
-            }
             else if ("-r".equals(argv[i])) {
                 if (i + 1 < argv.length) {
                     input = new Date(Long.parseLong(argv[++i]) * 1000L);
@@ -250,9 +244,6 @@ public class Posix {
                     throw new IllegalArgumentException("usage: date [-u] [-r seconds] [-v[+|-]val[mwdHMS]
...] [-f input_fmt new_date] [+output_fmt]");
                 }
             }
-            else if (argv[i].startsWith("-v")) {
-                adjs.add(argv[i].substring(2));
-            }
             else if (argv[i].startsWith("+")) {
                 if (output == null) {
                     output = argv[i].substring(1);
@@ -267,10 +258,6 @@ public class Posix {
         if (output == null) {
             output = "%c";
         }
-        // Perform adjustments
-        for (String adj : adjs) {
-            // TODO:
-        }
         // Print output
         System.out.println(new SimpleDateFormat(toJavaDateFormat(output)).format(input));
     }



Mime
View raw message