DragonFly submit List (threaded) for 2009-03
DragonFly BSD
DragonFly submit List (threaded) for 2009-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: another undo patch: a feature request and implementation, should it be of interest


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Mar 2009 23:39:41 -0700 (PDT)

:orm.
:I guess trying to use immediate number options with multiple
:characters is simply not possible to get clean as opposed to merely
:working when getopt is used for options. While slightly more verbose
:in usage, the code for using a standard option with argument is rather
:much nicer, yes.
:
:...
:Should I send such a patch? Alternatively, if you copy the main()
:function from before the feature patch, move the initiation of the
:"flags" variable to before the option-reading loop, then such code can
:simply be inserted for case 't'.

    Send a complete patch w/ everything, using the new scheme, and I'll
    commit it.

    I'm not sure the logic you posted will properly sequence ts1 and
    ts2.  I suggest just tracking the sequencing separately instead
    of using ts1.tid and the flags variable.

    Then for updating the flags just pass additional arguments
    to parse_delta_time() and let parse_delta_time() make the
    distinction and adjust the flags  e.g.:

    case 't':
	++count_t;
	if (count_t == 1)
		ts1.tid = parse_delta_time(optarg, &flags, UNDO_FLAG_SETTID1);
	else
		ts2.tid = parse_delta_time(optarg, &flags, UNDO_FLAG_SETTID2);
	else
		usage();
	break;
    ...

    Or something like that.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]