[sword-svn] r3861 - trunk/utilities

scribe at crosswire.org scribe at crosswire.org
Sat May 15 06:53:01 EDT 2021


Author: scribe
Date: 2021-05-15 06:53:01 -0400 (Sat, 15 May 2021)
New Revision: 3861

Modified:
   trunk/utilities/installmgr.cpp
Log:
Added option to installmgr to list source names only, making scripting easier


Modified: trunk/utilities/installmgr.cpp
===================================================================
--- trunk/utilities/installmgr.cpp	2021-05-04 21:27:04 UTC (rev 3860)
+++ trunk/utilities/installmgr.cpp	2021-05-15 10:53:01 UTC (rev 3861)
@@ -191,7 +191,6 @@
 	mgr        = 0;
 
 	if (status < 1) {
-		cout << "\n";
 		exit(status);
 	}
 }
@@ -265,14 +264,21 @@
 }
 
 
-void listRemoteSources() {
+void listRemoteSources(bool namesOnly = false) {
 	init();
-	cout << "Remote Sources:\n\n";
+	if (!namesOnly) {
+		cout << "Remote Sources:\n\n";
+	}
 	for (InstallSourceMap::iterator it = installMgr->sources.begin(); it != installMgr->sources.end(); it++) {
-		cout << "[" << it->second->caption << "]\n";
-		cout << "\tType     : " << it->second->type << "\n";
-		cout << "\tSource   : " << it->second->source << "\n";
-		cout << "\tDirectory: " << it->second->directory << "\n";
+		if (namesOnly) {
+			cout << it->second->caption << "\n";
+		}
+		else {
+			cout << "[" << it->second->caption << "]\n";
+			cout << "\tType     : " << it->second->type << "\n";
+			cout << "\tSource   : " << it->second->source << "\n";
+			cout << "\tDirectory: " << it->second->directory << "\n";
+		}
 	}
 }
 
@@ -415,6 +421,7 @@
 		"\t -sc\t\t\t\tsync config with known remote repo list\n"
 		"\t\t\t\t\t\tNOTE: also creates if none exists\n"
 		"\t -s\t\t\t\tlist remote sources\n"
+		"\t -sn\t\t\t\tlist remote sources names only\n"
 		"\t -r  <remoteSrcName>\t\trefresh remote source\n"
 		"\t -rl <remoteSrcName>\t\tlist available user modules from remote source\n"
 		"\t -rlu <remoteSrcName>\t\tlist available utility modules from remote source\n"
@@ -480,6 +487,9 @@
 		else if (!strcmp(argv[i], "-s")) {	// list sources
 			listRemoteSources();
 		}
+		else if (!strcmp(argv[i], "-sn")) {	// list sources
+			listRemoteSources(true);
+		}
 		else if (!strcmp(argv[i], "-sc")) {	// sync config with master
 			syncConfig();
 		}



More information about the sword-cvs mailing list