1 #define INCLUDE_TESTSETUP_WITHOUT_BOOST
2 #include "../tests/lib/TestSetup.h"
3 #undef INCLUDE_TESTSETUP_WITHOUT_BOOST
7 #include <zypp/DiskUsageCounter.h>
13 static std::string appname { "NO_NAME" };
15 int errexit( const std::string & msg_r = std::string(), int exit_r = 100 )
17 if ( ! msg_r.empty() )
18 cerr << endl << appname << ": ERR: " << msg_r << endl << endl;
22 int usage( const argparse::Options & options_r, int return_r = 0 )
24 cerr << "USAGE: " << appname << " [OPTION]... [ARGS]..." << endl;
25 cerr << " Print default mountpoint set for disk usage computation." << endl;
26 cerr << options_r << endl;
30 int main( int argc, char * argv[] )
32 appname = Pathname::basename( argv[0] );
34 std::string sysRoot { "/" };
36 argparse::Options options;
38 ( "help,h", "Print help and exit." )
39 ( "root", "Use the system located below ROOTDIR.", argparse::Option::Arg::required )
41 auto result = options.parse( argc, argv );
43 if ( result.count( "help" ) )
44 return usage( options );
46 if ( result.count( "root" ) )
47 sysRoot = result["root"].arg();
50 cout << "DiskUsageCounter: relevant mount points detected below '" << sysRoot << "':" << endl;
51 cout << DiskUsageCounter::detectMountPoints( sysRoot ) << endl;