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().sign().recipient("0xrecipient").output();
    /*
    GPG.decrypt().armor().local-user("0xlocaluser").output("/tmp/a-file");
    GPG.sign().armor().();
    */
  }

  private List<String> command = new ArrayList<String>();
  private static GPG gpg = null;

  public void output() {
    println("Command: " + command);
    println("----------");
  }

  public static GPG encrypt() {
    gpg = (null == gpg) ? new GPG() : gpg;
    gpg.command.add("--encrypt");
    return gpg;
  }

  public static GPG decrypt() {
    gpg = (null == gpg) ? new GPG() : gpg;
    gpg.command.add("--decrypt");
    return gpg;
  }

  public static GPG sign() {
    gpg = (null == gpg) ? new GPG() : gpg;
    gpg.command.add("--sign");
    return gpg;
  }

  public GPG armor() {
    command.add("--armor");
    return this;
  }

  // TODO: Add recipients(List<String> recipients)
  public GPG recipient(String recipient) {
    command.add("--recipient " + recipient);
    return this;
  }
}

@@ -1229,11 +1229,122 @@
 his;%0A  %7D
+%0A%0A  public GPG localUser(String localUser) %7B%0A    command.add(%22--local-user %22 + localUser);%0A    return this;%0A  %7D
 %0A%7D%0A

Add local-user