-
Notifications
You must be signed in to change notification settings - Fork 790
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make nano_wallet for Windows console (#1653)
* Make nano_wallet for Windows console * Formatting * Link to latest supported VC++ Redistributable 2017 https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads * Add .com file to AppVeyor zip archive * Proper 7z command
- Loading branch information
Showing
3 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <nano/lib/errors.hpp> | ||
#include <nano/lib/utility.hpp> | ||
#include <nano/node/cli.hpp> | ||
#include <nano/node/rpc.hpp> | ||
#include <nano/node/working.hpp> | ||
|
||
#include <boost/make_shared.hpp> | ||
#include <boost/program_options.hpp> | ||
|
||
int main (int argc, char * const * argv) | ||
{ | ||
nano::set_umask (); | ||
try | ||
{ | ||
boost::program_options::options_description description ("Command line options"); | ||
description.add_options () ("help", "Print out options"); | ||
nano::add_node_options (description); | ||
boost::program_options::variables_map vm; | ||
boost::program_options::store (boost::program_options::command_line_parser (argc, argv).options (description).allow_unregistered ().run (), vm); | ||
boost::program_options::notify (vm); | ||
int result (0); | ||
|
||
if (!vm.count ("data_path")) | ||
{ | ||
std::string error_string; | ||
if (!nano::migrate_working_path (error_string)) | ||
{ | ||
throw std::runtime_error (error_string); | ||
} | ||
} | ||
|
||
auto ec = nano::handle_node_options (vm); | ||
if (ec == nano::error_cli::unknown_command && vm.count ("help") != 0) | ||
{ | ||
std::cout << description << std::endl; | ||
} | ||
return result; | ||
} | ||
catch (std::exception const & e) | ||
{ | ||
std::cerr << boost::str (boost::format ("Exception while initializing %1%") % e.what ()); | ||
} | ||
catch (...) | ||
{ | ||
std::cerr << boost::str (boost::format ("Unknown exception while initializing")); | ||
} | ||
return 1; | ||
} |