X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=examples%2Fls.cpp;h=3e873180d57bf04b72e53b40281bf9088693a2c2;hp=fd4d71f382bd6212c8e8d9ec0adb3c74636be12d;hb=31cc8f0c6e874e2417e76eda50af34fd17bcd90c;hpb=857c4856742bc3f5b327098b3f82e4cb58644d2b diff --git a/examples/ls.cpp b/examples/ls.cpp index fd4d71f..3e87318 100644 --- a/examples/ls.cpp +++ b/examples/ls.cpp @@ -31,9 +31,9 @@ Ls::Ls(int argc, char **argv): { GetOpt getopt; getopt.add_option('l', "long", long_format, GetOpt::NO_ARG); + getopt.add_argument("file", args, GetOpt::OPTIONAL_ARG); getopt(argc, argv); - args = getopt.get_args(); if(args.empty()) args.push_back("."); } @@ -122,7 +122,7 @@ void Ls::print_rows(const list &rows) if(row.size()>col_width.size()) col_width.resize(row.size(), 0); for(unsigned j=0; j(col_width[j], row[j].size()); } for(list::const_iterator i=rows.begin(); i!=rows.end(); ++i)