<commit_before>package com.bunkr_beta.cli;

import com.bunkr_beta.interfaces.IPasswordPrompter;

import java.io.Console;

/**
 * Creator: benmeier
 * Created At: 2015-12-02
 */
public class CLIPasswordPrompt implements IPasswordPrompter
{
    @Override
    public byte[] getPassword()
    {
        Console console = System.console();
        if (console == null)
        {
            System.err.println("Couldn't get Console instance");
            System.exit(1);
        }
        return new String(console.readPassword("Enter password for archive: ")).getBytes();
    }
}<commit_msg>Better error message for console = null<commit_after>package com.bunkr_beta.cli;

import com.bunkr_beta.interfaces.IPasswordPrompter;

import java.io.Console;

/**
 * Creator: benmeier
 * Created At: 2015-12-02
 */
public class CLIPasswordPrompt implements IPasswordPrompter
{
    @Override
    public byte[] getPassword()
    {
        Console console = System.console();
        if (console == null)
        {
            System.err.println(
                    "Couldn't get Console instance. You might not be in a pseudo terminal or may be " +
                    "redirecting stdout or stdin in some way.\n\n" +

                    "Please use the '--password-file' cli option instead in this case."
            );
            System.exit(1);
        }
        return new String(console.readPassword("Enter password for archive: ")).getBytes();
    }
}
{'fraction_non_alphanumeric': 0.10580912863070539, 'fraction_numerical': 0.012448132780082987, 'mean_word_length': 2.4047058823529412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336443', 'n_tokens_mistral': 436, 'n_tokens_neox': 415, 'n_words': 110}