Commit f07a18ab authored by Claes Sjofors's avatar Claes Sjofors

wb option -s to open dbs-file for volume instead of db

parent 622f5737
......@@ -137,6 +137,7 @@ WbGtk::WbGtk( int argc, char *argv[]) : mainwindow(0)
char filename[200];
int i;
int quiet = 0;
unsigned int options = 0;
Wb::main_wb = this;
......@@ -160,9 +161,13 @@ WbGtk::WbGtk( int argc, char *argv[]) : mainwindow(0)
volumename_p = 0;
break;
case 'q':
// Load all volumes
// Quiet
quiet = 1;
break;
case 's':
// Open dbs file
options |= ldh_mWbOption_OpenDbs;
break;
case 'l':
if ( i+1 >= argc) {
usage();
......@@ -238,7 +243,7 @@ WbGtk::WbGtk( int argc, char *argv[]) : mainwindow(0)
CoXHelpGtk *xhelp = new CoXHelpGtk( mainwindow, 0, xhelp_eUtility_Wtt, &sts);
CoXHelp::set_default( xhelp);
sts = ldh_OpenWB(&wbctx, volumename_p, 0);
sts = ldh_OpenWB(&wbctx, volumename_p, options);
psts(sts, NULL);
if (EVEN(sts)) exit(sts);
......
......@@ -83,10 +83,11 @@ Wb *Wb::main_wb = 0;
void Wb::usage()
{
printf("\n\
Usage: wb [-a][-q][-c][-p] [-l language] [username] [password] [volume]\n\
Usage: wb [-a][-q][-s][-c][-p] [-l language] [username] [password] [volume]\n\
\n\
-a Attach all databases.\n\
-q Quiet. Hide license information.\n\
-s Open dbs file for volume.\n\
-c Start class editor.\n\
-p Open project list.\n\
-l Language specification, sv_se or en_us.\n\
......
......@@ -780,9 +780,9 @@ void wb_erep::loadMeta( pwr_tStatus *status, char *db)
MsgWindow::message( 'E', "Database not found", vname);
}
else {
int open_loadfile = 0;
int open_loadfile = m_options & ldh_mWbOption_OpenDbs ? 1 : 0;
if ( wb_dblock::is_locked(vname, uname)) {
if ( wb_dblock::is_locked(vname, uname) && !open_loadfile) {
char msg[120];
sprintf( msg, "Database %s is locked by user %s", vol_array[0], uname);
......
......@@ -152,7 +152,8 @@ typedef enum {
} ldh_eDId;
typedef enum {
ldh_mWbOption_IgnoreDLoadError = 1 << 0
ldh_mWbOption_IgnoreDLoadError = 1 << 0,
ldh_mWbOption_OpenDbs = 1 << 1
} ldh_mWbOption;
typedef enum {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment