};
Z::Z(int argc, char **argv):
- input_file(0)
+ input_file(nullptr)
{
+ string input_fn;
GetOpt getopt;
getopt.add_option('d', "decompress", decompress, GetOpt::NO_ARG);
+ getopt.add_argument("filename", input_fn, GetOpt::OPTIONAL_ARG);
getopt(argc, argv);
- const vector<string> &args = getopt.get_args();
- if(!args.empty())
- input_file = new IO::File(args[0]);
+ if(!input_fn.empty())
+ input_file = new IO::File(input_fn);
input = (input_file ? static_cast<IO::Base *>(input_file) : static_cast<IO::Base *>(&IO::cin));
output = &IO::cout;