Browse Source

HV: * Got rid of '-h' and '-f' FUSE options; the VBS_FS

doesn't have to parse them

git-svn-id: svn+ssh://code.jive.eu/code/svn/vbs_fs@3 5b2df0cb-e17b-44c8-90c8-480d528b6e0d
master
JIVE Software Dev 5 years ago
parent
commit
8afefba31c
1 changed files with 2 additions and 32 deletions
  1. +2
    -32
      vbs_fs.cc

+ 2
- 32
vbs_fs.cc View File

@@ -116,12 +116,11 @@ struct fuse_operations vbs_oper = {
struct vbs_settings {
int debug_level;
bool help;
bool foreground;
char const* root_dir;

// Initialize with defaults
vbs_settings():
debug_level( 0 ), help( false ), foreground( false ), root_dir( 0 )
debug_level( 0 ), help( false ), root_dir( 0 )
{}
};

@@ -131,8 +130,6 @@ ostream& operator<<(ostream& os, const vbs_settings& vbo) {
os << "-r " << vbo.root_dir << " ";
if( vbo.help )
os << "-h" << " ";
if( vbo.foreground )
os << "-f" << " ";
return os;
}

@@ -144,26 +141,14 @@ struct fuse_opt vbs_options[] = {
VBSFS_OPT("-r %s", root_dir, 0),
// The FUSE_OPT_KEY() ones are handled
// by vbs_option_proc()
//FUSE_OPT_KEY("-f", KEY_FOREGROUND),
//FUSE_OPT_KEY("-h", KEY_HELP),
FUSE_OPT_END
};

int vbs_option_proc(void* data, const char* arg, int key, struct fuse_args* /*outargs*/) {
int vbs_option_proc(void* data, const char* arg, int /*key*/, struct fuse_args* /*outargs*/) {
int rv = 1;
const string arg_s( arg );
vbs_settings* settingsptr = (vbs_settings*)data;

if( key==KEY_FOREGROUND ) {
rv = 0;
settingsptr->foreground = true;
} else if( key==KEY_HELP ) {
rv = 0;
settingsptr->help = true;
} else {
DEBUG(-1, "vbs_option_proc/Unrecognized arg=" << arg << " (key=" << key << ")" << endl);
}
if( arg_s=="-h" )
settingsptr->help = true;
return rv;
@@ -171,10 +156,6 @@ int vbs_option_proc(void* data, const char* arg, int key, struct fuse_args* /*ou

void Usage( void ) {
cout << "VBS specific command line arguments:" << endl
#if 0
<< " -h print this message" << endl
<< " -f run FUSE in the foreground, not as daemon" << endl
#endif
<< " -m <int> set VBS_FS debug print level to <n>" << endl
<< " higher <n> => more output, default 0 (no output)" << endl
<< " -r <path> path to vbs_fs 'root' directory; assume all disks" << endl
@@ -208,17 +189,6 @@ int main(int argc, char** argv) {
::fuse_opt_parse(&args, (void*)&settings, &vbs_options[0], vbs_option_proc);
DEBUG(1, "fuse_opt_arg done [" << settings << "]" << endl);

#if 0
// Append to FUSE 'command line'
if( settings.foreground && ::fuse_opt_add_arg(&args, "-f")!=0 ) {
DEBUG(-1, "fuse_opt_add_arg(.., \"-f\") fails?!" << endl);
return -12;
}
if( settings.help && ::fuse_opt_add_arg(&args, "-h")!=0 ) {
DEBUG(-1, "fuse_opt_add_arg(.., \"-h\") fails?!" << endl);
return -13;
}
#endif
if( settings.help )
Usage();
// If no root dir given, default to "/mnt"


Loading…
Cancel
Save