@@ -0,0 +1,1295 @@
+package picocli.examples.interactive;%0A%0Aimport picocli.CommandLine;%0Aimport picocli.CommandLine.Model.CommandSpec;%0Aimport picocli.CommandLine.Option;%0Aimport picocli.CommandLine.ParameterException;%0Aimport picocli.CommandLine.Spec;%0A%0Aimport java.io.File;%0A%0Apublic class PasswordDemo implements Runnable %7B%0A    @Option(names = %22--password:file%22)%0A    File passwordFile;%0A%0A    @Option(names = %22--password:env%22)%0A    String passwordEnvironmentVariable;%0A%0A    @Option(names = %22--password%22, interactive = true)%0A    String password;%0A%0A    @Spec%0A    CommandSpec spec;%0A%0A    public void run() %7B%0A        if (password != null) %7B%0A            login(password);%0A        %7D else if (passwordEnvironmentVariable != null) %7B%0A            login(System.getenv(passwordEnvironmentVariable));%0A        %7D else if (passwordFile != null) %7B%0A            // below uses Java 8 NIO, create your own on older Java versions%0A            /*%0A            login(new String(Files.readAllBytes(passwordFile.toPath())));%0A            */%0A        %7D else %7B%0A            throw new ParameterException(spec.commandLine(), %22Password required%22);%0A        %7D%0A    %7D%0A%0A    private void login(String pwd) %7B%0A        System.out.printf(%22Password: %25s%25n%22, pwd);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        CommandLine.run(new PasswordDemo(), args);%0A    %7D%0A%7D%0A

add example for interactive password alternatives