[Gnucash-changes] r12020 - gnucash/trunk - Remove redundant RPC variable

Derek Atkins warlord at MIT.EDU
Wed Nov 23 10:17:59 EST 2005


Sorry, Neil, but you're still wrong.  This, for example, is COMPLETELY BOGUS:

[warlord at cliodev src]$ /opt/gnucash-svn/bin/gnucash --help
Usage: gnucash [ option ... ] [ datafile ]

  --version                   Show GnuCash version
  --usage                     Show GnuCash usage information
  --help                      Show this help message
  --debug                     Enable debugging mode
  --devel                     Enable developers mode
  --loglevel LOGLEVEL         Set the logging level from 0 (least) to 6 (most)
  --nofile                    Do not load the last file opened
  --config-path CONFIGPATH    Set configuration path
  --share-path SHAREPATH      Set shared data file search path
  --doc-path DOCPATH          Set the search path for documentation files
  --evaluate COMMAND          Evaluate the guile command
  --load FILE                 Load the given .scm file
  --add-price-quotes FILE     Add price quotes to given FILE.
  --namespace                 Regular expression determining which namespace
commodities will be retrieved
  --load-user-config          Load the user configuration
  --load-system-config        Load the system configuration
  --rpc-server                Run the RPC Server if GnuCash was configured with
--enable-rpc

-derek

Quoting Neil Williams <linux at codehelp.co.uk>:

> On Wednesday 23 November 2005 1:02 am, Derek Atkins wrote:
>> Umm, but you've left the code in a state where a user can cause gnucash
>> to crash because there's a missing symbol!
>
> No, I did not. With the current code, starting gnucash with:
> gnucash --rpc-server
> fails with an error message. OK, that message could be improved, but at least
> anyone who is (for some unknown reason) using RPC with gnucash despite the
> warnings, will find:
> 1. svn won't build with the --enable-rpc option - no such option exists.
> 2. gnucash won't start with the --rpc-server command as may be used in a
> variety of scripts that this theoretical user may have.
>
>> It's not too hard to remove
>> the references to gnc:run-rpc-server in the command-line scm file.
>
> When I do that, gnucash starts up fine with absolutely no warnings, errors or
> reports - making the user believe that the RPC server is fully functional!
>
> I believe that is wrong. Absolutely the wrong thing to do. Far better 
> that the
> user gets an error message of some kind, even if it isn't the most helpful in
> the world.
>
>> Personally we'd be better off in the short run just creating a gnucash
>> binary in C that just calls the guile interpretter -- so we're not
>> dependent on /usr/bin/guile being the correct version.  But that still
>> requires changing command-line.scm.
>
> It would require deleting it. I'd replace all the command line options with
> popt. I was not thinking of providing any command-line guile access.
>
>> Please don't be lazy.
>
> I'm not. I deliberately left the command line options untouched because:
> 1. I aim to replace them soon
> 2. I knew gnucash would not inform the user that a command line option had
> been removed.
>
> gnucash currently starts with any arbitrary command line. You can pass it
> absolute junk and there is no complaint. That isn't right.
>
> Try this command line:
> gnucash --dsfs234 --sere3w43
>
> That's appalling behaviour. At the very least it should print a usage message
> and inform the user:
> a) that a bad option was passed
> b) the accepted options.
>
> popt does this with just a couple of lines of C.
>
>> Yes, we did..  But we did NOT agree that we should add the ability for
>> users to crash gnucash
>
> gnucash does *not* crash as-is. It reports an error, as it should.
>
>> by giving it command-line arguments that point off
>> to non-existant functions.
>
> You can pass complete nonsense to gnucash without a crash. At least as-is, a
> previously valid option raises an error, such as it is.
>
>> Who knows if we'll get this re-write done in
>> time for 2.0?  I doubt it.
>
> I'm expecting to be able to do that. The majority of the code is already in
> cashutil.
>
>> It's 60 seconds of work to clean this up.  Please do it.
>
> I'd rather not mislead users into thinking rpc-server is suddenly enabled by
> default. We've removed some functionality, (albeit rarely used), users are
> right to expect an error if they try to use that functionality. It is not a
> crash, it is a simple (if not directly helpful) error.
>
> --
>
> Neil Williams
> =============
> http://www.data-freedom.org/
> http://www.nosoftwarepatents.com/
> http://www.linux.codehelp.co.uk/
>
>



-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list