#include "alternatives.ih"

Alternatives::ViableResult Alternatives::viable()
{
    imsg << boolalpha  << "Search from $HOME: " << d_fromHome << '\n' <<
                "Search all directories: " << d_allDirs << '\n' <<
                "Add root search if search from  $HOME fails: " <<
                                            d_options.triStateStr() << endl;

    if (globFrom(determineInitialDirectory()) == ONLY_CD)
        return ONLY_CD;

    sort(begin(), begin() + d_nInHistory);
    sort(begin() + d_nInHistory, end());

    return RECEIVED_ALTERNATIVES;
}
