Fossil SCM

Add the --page option to the "fossil ui" command.

drh 2015-12-15 14:46 trunk
Commit f55f64e2d85557e88c51526cf47c23e28da3c0d8
1 file changed +16 -6
+16 -6
--- src/main.c
+++ src/main.c
@@ -2381,10 +2381,11 @@
23812381
** by default.
23822382
**
23832383
** Options:
23842384
** --baseurl URL Use URL as the base (useful for reverse proxies)
23852385
** --create Create a new REPOSITORY if it does not already exist
2386
+** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
23862387
** --files GLOBLIST Comma-separated list of glob patterns for static files
23872388
** --localauth enable automatic login for requests from localhost
23882389
** --localhost listen on 127.0.0.1 only (always true for "ui")
23892390
** --nojail Drop root privileges but do not enter the chroot jail
23902391
** --notfound URL Redirect
@@ -2410,11 +2411,12 @@
24102411
#endif
24112412
int allowRepoList; /* List repositories on URL "/" */
24122413
const char *zAltBase; /* Argument to the --baseurl option */
24132414
const char *zFileGlob; /* Static content must match this */
24142415
char *zIpAddr = 0; /* Bind to this IP address */
2415
- int fCreate = 0;
2416
+ int fCreate = 0; /* The --create flag */
2417
+ char *zInitPage = 0; /* Start on this page. --page option */
24162418
24172419
#if defined(_WIN32)
24182420
const char *zStopperFile; /* Name of file used to terminate server */
24192421
zStopperFile = find_option("stopper", 0, 1);
24202422
#endif
@@ -2432,10 +2434,15 @@
24322434
noJail = find_option("nojail",0,0)!=0;
24332435
#endif
24342436
g.useLocalauth = find_option("localauth", 0, 0)!=0;
24352437
Th_InitTraceLog();
24362438
zPort = find_option("port", "P", 1);
2439
+ isUiCmd = g.argv[1][0]=='u';
2440
+ if( isUiCmd ){
2441
+ zInitPage = find_option("page", 0, 1);
2442
+ }
2443
+ if( zInitPage==0 ) zInitPage = "";
24372444
zNotFound = find_option("notfound", 0, 1);
24382445
allowRepoList = find_option("repolist",0,0)!=0;
24392446
zAltBase = find_option("baseurl", 0, 1);
24402447
fCreate = find_option("create",0,0)!=0;
24412448
if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
@@ -2448,11 +2455,10 @@
24482455
24492456
/* We should be done with options.. */
24502457
verify_all_options();
24512458
24522459
if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
2453
- isUiCmd = g.argv[1][0]=='u';
24542460
if( isUiCmd ){
24552461
flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST;
24562462
g.useLocalauth = 1;
24572463
allowRepoList = 1;
24582464
}
@@ -2488,13 +2494,15 @@
24882494
}
24892495
#else
24902496
zBrowser = db_get("web-browser", "open");
24912497
#endif
24922498
if( zIpAddr ){
2493
- zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr);
2499
+ zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
2500
+ zBrowser, zIpAddr, zInitPage);
24942501
}else{
2495
- zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
2502
+ zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
2503
+ zBrowser, zInitPage);
24962504
}
24972505
if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
24982506
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
24992507
}
25002508
db_close(1);
@@ -2519,13 +2527,15 @@
25192527
#else
25202528
/* Win32 implementation */
25212529
if( isUiCmd ){
25222530
zBrowser = db_get("web-browser", "start");
25232531
if( zIpAddr ){
2524
- zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr);
2532
+ zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
2533
+ zBrowser, zIpAddr, zInitPage);
25252534
}else{
2526
- zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
2535
+ zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
2536
+ zBrowser, zInitPage);
25272537
}
25282538
if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
25292539
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
25302540
}
25312541
db_close(1);
25322542
--- src/main.c
+++ src/main.c
@@ -2381,10 +2381,11 @@
2381 ** by default.
2382 **
2383 ** Options:
2384 ** --baseurl URL Use URL as the base (useful for reverse proxies)
2385 ** --create Create a new REPOSITORY if it does not already exist
 
2386 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2387 ** --localauth enable automatic login for requests from localhost
2388 ** --localhost listen on 127.0.0.1 only (always true for "ui")
2389 ** --nojail Drop root privileges but do not enter the chroot jail
2390 ** --notfound URL Redirect
@@ -2410,11 +2411,12 @@
2410 #endif
2411 int allowRepoList; /* List repositories on URL "/" */
2412 const char *zAltBase; /* Argument to the --baseurl option */
2413 const char *zFileGlob; /* Static content must match this */
2414 char *zIpAddr = 0; /* Bind to this IP address */
2415 int fCreate = 0;
 
2416
2417 #if defined(_WIN32)
2418 const char *zStopperFile; /* Name of file used to terminate server */
2419 zStopperFile = find_option("stopper", 0, 1);
2420 #endif
@@ -2432,10 +2434,15 @@
2432 noJail = find_option("nojail",0,0)!=0;
2433 #endif
2434 g.useLocalauth = find_option("localauth", 0, 0)!=0;
2435 Th_InitTraceLog();
2436 zPort = find_option("port", "P", 1);
 
 
 
 
 
2437 zNotFound = find_option("notfound", 0, 1);
2438 allowRepoList = find_option("repolist",0,0)!=0;
2439 zAltBase = find_option("baseurl", 0, 1);
2440 fCreate = find_option("create",0,0)!=0;
2441 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
@@ -2448,11 +2455,10 @@
2448
2449 /* We should be done with options.. */
2450 verify_all_options();
2451
2452 if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
2453 isUiCmd = g.argv[1][0]=='u';
2454 if( isUiCmd ){
2455 flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST;
2456 g.useLocalauth = 1;
2457 allowRepoList = 1;
2458 }
@@ -2488,13 +2494,15 @@
2488 }
2489 #else
2490 zBrowser = db_get("web-browser", "open");
2491 #endif
2492 if( zIpAddr ){
2493 zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr);
 
2494 }else{
2495 zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
 
2496 }
2497 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2498 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2499 }
2500 db_close(1);
@@ -2519,13 +2527,15 @@
2519 #else
2520 /* Win32 implementation */
2521 if( isUiCmd ){
2522 zBrowser = db_get("web-browser", "start");
2523 if( zIpAddr ){
2524 zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr);
 
2525 }else{
2526 zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
 
2527 }
2528 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2529 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2530 }
2531 db_close(1);
2532
--- src/main.c
+++ src/main.c
@@ -2381,10 +2381,11 @@
2381 ** by default.
2382 **
2383 ** Options:
2384 ** --baseurl URL Use URL as the base (useful for reverse proxies)
2385 ** --create Create a new REPOSITORY if it does not already exist
2386 ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
2387 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2388 ** --localauth enable automatic login for requests from localhost
2389 ** --localhost listen on 127.0.0.1 only (always true for "ui")
2390 ** --nojail Drop root privileges but do not enter the chroot jail
2391 ** --notfound URL Redirect
@@ -2410,11 +2411,12 @@
2411 #endif
2412 int allowRepoList; /* List repositories on URL "/" */
2413 const char *zAltBase; /* Argument to the --baseurl option */
2414 const char *zFileGlob; /* Static content must match this */
2415 char *zIpAddr = 0; /* Bind to this IP address */
2416 int fCreate = 0; /* The --create flag */
2417 char *zInitPage = 0; /* Start on this page. --page option */
2418
2419 #if defined(_WIN32)
2420 const char *zStopperFile; /* Name of file used to terminate server */
2421 zStopperFile = find_option("stopper", 0, 1);
2422 #endif
@@ -2432,10 +2434,15 @@
2434 noJail = find_option("nojail",0,0)!=0;
2435 #endif
2436 g.useLocalauth = find_option("localauth", 0, 0)!=0;
2437 Th_InitTraceLog();
2438 zPort = find_option("port", "P", 1);
2439 isUiCmd = g.argv[1][0]=='u';
2440 if( isUiCmd ){
2441 zInitPage = find_option("page", 0, 1);
2442 }
2443 if( zInitPage==0 ) zInitPage = "";
2444 zNotFound = find_option("notfound", 0, 1);
2445 allowRepoList = find_option("repolist",0,0)!=0;
2446 zAltBase = find_option("baseurl", 0, 1);
2447 fCreate = find_option("create",0,0)!=0;
2448 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
@@ -2448,11 +2455,10 @@
2455
2456 /* We should be done with options.. */
2457 verify_all_options();
2458
2459 if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
 
2460 if( isUiCmd ){
2461 flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST;
2462 g.useLocalauth = 1;
2463 allowRepoList = 1;
2464 }
@@ -2488,13 +2494,15 @@
2494 }
2495 #else
2496 zBrowser = db_get("web-browser", "open");
2497 #endif
2498 if( zIpAddr ){
2499 zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
2500 zBrowser, zIpAddr, zInitPage);
2501 }else{
2502 zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
2503 zBrowser, zInitPage);
2504 }
2505 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2506 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2507 }
2508 db_close(1);
@@ -2519,13 +2527,15 @@
2527 #else
2528 /* Win32 implementation */
2529 if( isUiCmd ){
2530 zBrowser = db_get("web-browser", "start");
2531 if( zIpAddr ){
2532 zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
2533 zBrowser, zIpAddr, zInitPage);
2534 }else{
2535 zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
2536 zBrowser, zInitPage);
2537 }
2538 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2539 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2540 }
2541 db_close(1);
2542

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button