From 55fdda9bf5c543b840e2e3a50da49e0c1ee430d8 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de> Date: Mon, 15 Dec 2014 10:25:11 +0100 Subject: [PATCH] Command modifier for in-place operation now "!" instead of "=", as inspired by Ruby. --- pub/lib/commands.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pub/lib/commands.cpp b/pub/lib/commands.cpp index 64507f3e..789d454f 100644 --- a/pub/lib/commands.cpp +++ b/pub/lib/commands.cpp @@ -46,9 +46,9 @@ bool fridaCommand( string cmd ) // Extract overwrite marker: NOlm::overwrite = 0; - if( cmd=="=" ) + if( cmd=="!" ) throw "overwrite marker = must immediately follow a command"; - if ( cmd!="" && cmd[cmd.size()-1]=='=' ) { + if ( cmd!="" && cmd[cmd.size()-1]=='!' ) { NOlm::overwrite = 1; cmd.erase(cmd.size()-1,1); } @@ -77,18 +77,13 @@ bool fridaCommand( string cmd ) " o operate on variables, compute integrals, ...\n" " r read raw data (currently only for SPHERES)\n" " _ special / temporary commands\n" + "Modifier (appended to command):\n" + " ! operate in place (overwrite)\n" "More help:\n" " \\h help on meta commands and macros\n" - " hm command modifiers\n" " hf math operators and functions\n" ; - } else if (cmd == "hm") { - cout << - "Command modifiers:\n" - " <cmd>= overwrite the file instead of creating a new one\n" - ; - } else if (cmd == "hf") { cout << NFunctions::list(); -- GitLab