Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add the ability to set the config dir via a --configDir command line …
…option.
  • Loading branch information
baumgarr committed Feb 20, 2017
1 parent 82cdd80 commit 1e5a179
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions settings/startupconfig.cpp
Expand Up @@ -65,8 +65,9 @@ void StartupConfig::printHelp() {
+QString(" start <options> Start NixNote GUI with the specified options.\n")
+QString(" If no command is specified, this is the default.\n")
+QString(" start options:\n")
+QString(" --accountId=<id> Start with specified user account\n")
+QString(" --dontStartMinimized Override option to start minimized\n")
+QString(" --accountId=<id> Start with specified user account.\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" --dontStartMinimized Override option to start minimized.\n")
+QString(" --disableEditing Disable note editing\n")
+QString(" --enableIndexing Enable background Indexing (can cause problems)\n")
+QString(" --openNote=<lid> Open a specific note on startup\n")
Expand All @@ -80,6 +81,7 @@ void StartupConfig::printHelp() {
+QString(" query <options> If running, search NixNote and display the results.\n")
+QString(" query options:\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" --search=\"search string\" Search string.\n\n")
+QString(" --delimiter=\"character\" Character to place between fields. Defaults to |.\n")
+QString(" --noHeaders Do not show column headings.")
Expand Down Expand Up @@ -115,6 +117,7 @@ void StartupConfig::printHelp() {
+QString(" --noteText=\"<text>\" Text of the note. If not provided input\n")
+QString(" is read from stdin.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" appendNote <options> Append to an existing note.\n")
+QString(" appendNote options:\n")
+QString(" --id=\"<title>\" ID of note to append.\n")
Expand All @@ -125,6 +128,7 @@ void StartupConfig::printHelp() {
+QString(" --noteText=\"<text>\" Text of the note. If not provided input\n")
+QString(" is read from stdin.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" alterNote <options> Change a notes't notebook or tags.\n")
+QString(" alterNote options:\n")
+QString(" --id=\"<note_ids>\" Space separated list of note IDs to extract.\n")
Expand All @@ -138,14 +142,17 @@ void StartupConfig::printHelp() {
+QString(" yyyy-MM-ddTHH:mm:ss.zzzZ format or the literal 'now' to default\n")
+QString(" to the current date & time.")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" readNote <options> Read the text contents of a note.\n")
+QString(" --id=\"<note_id>\" ID of the note to read.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" deleteNote <options> Move a note to the trash via the command line.\n")
+QString(" deleteNote options:\n")
+QString(" --id=\"<note_id>\" ID of the note to delete.\n")
+QString(" --noVerify Do not prompt for verification.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" emailNote <options> Move a note to the trash via the command line.\n")
+QString(" emailNote options:\n")
+QString(" --id=\"<note_id>\" ID of the note to email.\n")
Expand All @@ -156,10 +163,12 @@ void StartupConfig::printHelp() {
+QString(" --note=\"<note>\" Additional comments.\n")
+QString(" --ccSelf Send a copy to yourself.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" backup <options> Backup the NixNote database.\n")
+QString(" backup options:\n")
+QString(" --output=<filename> Output filename.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" export <options> Export notes from NixNote.\n")
+QString(" export options:\n")
+QString(" --id=\"<note_ids>\" Space separated list of note IDs to extract.\n")
Expand All @@ -168,18 +177,22 @@ void StartupConfig::printHelp() {
+QString(" --deleteAfterExtract Delete notes after the extract completes.\n")
+QString(" --noVerifyDelete Don't verify deletions.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" import <options> Import notes from a NixNote extract (.nnex).\n")
+QString(" import options:\n")
+QString(" --input=\"filename\" Input file name.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" closeNotebook <options> Close a notebook.\n")
+QString(" closeNotebook options:\n")
+QString(" --notebook=\"notebook\" Notebook name.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" openNotebook <options> Open a closed a notebook.\n")
+QString(" openNotebook options:\n")
+QString(" --notebook=\"notebook\" Notebook name.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" signalGui <options> Send command to a running NixNote.\n")
+QString(" signalGui options:\n")
+QString(" --show Show NixNote if hidden.\n")
Expand All @@ -193,6 +206,7 @@ void StartupConfig::printHelp() {
+QString(" --newNote Create a new note.\n")
+QString(" --newExternalNote Create a new note in an external window.\n")
+QString(" --accountId=<id> Account number (defaults to last used account).\n\n")
+QString(" --configDir=<dir> Directory containing config & database.\n")
+QString(" Examples:\n\n")
+QString(" To Start NixNote, do a sync, and then exit.\n")
+QString(" nixnote2 start --syncAndExit\n\n")
Expand Down Expand Up @@ -247,6 +261,10 @@ int StartupConfig::init(int argc, char *argv[], bool &guiAvailable) {
parm = parm.mid(12);
accountId = parm.toInt();
}
if (parm.startsWith("--configDir=", Qt::CaseSensitive)) {
parm = parm.mid(12);
homeDirPath = parm;
}
if (parm.startsWith("addNote")) {
command->setBit(STARTUP_ADDNOTE,true);
if (newNote == NULL)
Expand Down

0 comments on commit 1e5a179

Please sign in to comment.