package se.soy.gpg;

import java.util.List;
import java.util.ArrayList;

public class GPG {
  // FIXME Remove when done
  static<T> void println(T arg) { System.out.println(arg); }

  public static void main(String[] args) {
    println("main");
    GPG.encrypt().armor().recipient("0xrecipient").output();
    /*
    GPG.encrypt().armor().recipient("0xrecipient").output();
    GPG.decrypt().armor().local-user("0xlocaluser").output("/tmp/a-file");
    GPG.sign().armor().();
    */
  }

  private boolean armor = false;
  private List<String> recipients = new ArrayList<String>();

  public void output() {
    println("OPTIONS:");
    println(String.format("armor?: %s", (armor) ? "true" : "false"));
    println(String.format("recipients?: %s", recipients));
  }

  public static GPG encrypt() {
    GPG gpg = new GPG();
    println("encrypt()");
    return gpg;
  }

  public GPG armor() {
    this.armor = true;
    return this;
  }

  public GPG recipient(String recipient) {
    this.recipients.add(recipient);
    return this;
  }
}

@@ -482,16 +482,39 @@
 */%0A  %7D%0A%0A
+  private String mode;%0A
   privat
@@ -538,16 +538,16 @@
  false;%0A
-
   privat
@@ -646,24 +646,70 @@
 OPTIONS:%22);%0A
+    println(String.format(%22mode: %25s%22, mode));%0A
     println(
@@ -895,24 +895,27 @@
     
-println(
+gpg.mode = 
 %22encrypt
 ()%22)
@@ -914,12 +914,9 @@
 rypt
-()%22)
+%22
 ;%0A  

Set a mode instead of prining it