<commit_before>/*
* The MIT License (MIT)
*
* Copyright (c) 2013 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "weather_service.hpp"

static const char * version = "0.1.0 Alpha";

static void print_help()
{
    std::cout << "cweather weather utility version : " << version
              << "\nusage cweather [COUNTRY] [CITY]"
              << "\nor cweather [OPTION]"
              << "\nValid options : "
              << "\n--help or -h :\n\tprints this help message."
              << "\n--about or --version or -v :\n\tprints version and copyright notice.\n";
}

static void print_info()
{
    std::cout << "cweather weather utility version : " << version
              << ".\nCopytight (C) 2013 <NAME>."
              << "\nReleased under MIT License."
              << "\nSource code and License can be found at http://github.com/ah450/cweather .\n";
}

int main( int argc, const char * argv[] )
{
    if( argc >= 3 )
        {
            cweather::service::WebServiceXWeatherService to_test;
            try
                {
                    auto data = to_test.get_weather_data( argv[1], argv[2] );
                    std::cout << "Temperature : " << data.temperature << " C."
                              << "\nWind Speed : " << data.wind_speed << " KPH."
                              << "\nWind Direction : " << data.wind_direction << " Degrees."
                              << "\nPressure : " << data.pressure << " Pascal."
                              << "\nVisibility : " << data.visibility << " Kilometers."
                              << "\nHumidity : " << data.humidity * 100 << "%." ;
                    return 0;
                }
            catch( cweather::exceptions::IncorrectLocationException& )
                {
                    std::cerr <<
                              "Incorrect paramaters.\nrun cweather --help for usage information.\n";
                }
        }
    else if ( argc == 2 )
        {
            auto argument = std::string( argv[1] );
            if( argument == "--about" || argument == "--version" || argument == "-v" )
                {
                    print_info();
                    return 0;
                }
            else
                {
                    print_help();
                }
        }
    else
        {
            print_help();
            return -1;
        }
}<commit_msg>Updates command line help output.<commit_after>/*
* The MIT License (MIT)
*
* Copyright (c) 2013 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "weather_service.hpp"

static const char * version = "0.1.0 Alpha";

static void print_help()
{
    std::cout << "cweather weather utility version : " << version
              << "\nusage cweather [COUNTRY] [CITY]"
              << "\nTo use with multi word city or country name use the following syntax : "
              << "\n\tcweather 'COUNTRY_WORD_ONE COUNTRY_WORD_TWO' 'CITY_WORD_ONE CITY_WORD_TWO'"
              << "\nor cweather [OPTION]"
              << "\nValid options : "
              << "\n--help or -h :\n\tprints this help message."
              << "\n--about or --version or -v :\n\tprints version and copyright notice.\n";
}

static void print_info()
{
    std::cout << "cweather weather utility version : " << version
              << ".\nCopytight (C) 2013 <NAME>."
              << "\nReleased under MIT License."
              << "\nSource code and License can be found at http://github.com/ah450/cweather .\n";
}

int main( int argc, const char * argv[] )
{
    if( argc >= 3 )
        {
            cweather::service::WebServiceXWeatherService to_test;
            try
                {
                    auto data = to_test.get_weather_data( argv[1], argv[2] );
                    std::cout << "Temperature : " << data.temperature << " C."
                              << "\nWind Speed : " << data.wind_speed << " KPH."
                              << "\nWind Direction : " << data.wind_direction << " Degrees."
                              << "\nPressure : " << data.pressure << " Pascal."
                              << "\nVisibility : " << data.visibility << " Kilometers."
                              << "\nHumidity : " << data.humidity * 100 << "%.\n" ;
                    return 0;
                }
            catch( cweather::exceptions::IncorrectLocationException& )
                {
                    std::cerr <<
                              "Incorrect paramaters.\nrun cweather --help for usage information.\n";
                }
        }
    else if ( argc == 2 )
        {
            auto argument = std::string( argv[1] );
            if( argument == "--about" || argument == "--version" || argument == "-v" )
                {
                    print_info();
                    return 0;
                }
            else
                {
                    print_help();
                }
        }
    else
        {
            print_help();
            return -1;
        }
}
{'fraction_non_alphanumeric': 0.11106364801366937, 'fraction_numerical': 0.007119464616260857, 'mean_word_length': 1.7806809184481394, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7006264', 'n_tokens_mistral': 1897, 'n_tokens_neox': 1758, 'n_words': 655}