bugGNU Screen - Bugs: bug #23857, Need a "getopt" for...


bug #23857: Need a "getopt" for screen commands

Submitter:  Micah Cowan <micahcowan>
Submitted:  Tue 15 Jul 2008 06:17:32 PM UTC
Votes: 35
Category:  Code Architecture Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  None
Fixed Release:  None Planned Release:  Later
Work Required:  0 - Hours
* Mandatory Fields

Add a New Comment Rich Markup

Sat 12 Sep 2009 08:36:46 PM UTC, comment #4: 

Looks like only a minority of commands take hyphen-prepended flags: bind, bindkey, command, detach, echo, hardcopy, height, help, readbuf, readreg, register, screen, windowlist, and writebuf. (Did I miss any?)

Do you have any other commonality in mind for factoring out?

There are also a number of commands that take on/off, but that appears to be handled by ParseOnOff already.

Max Kalashnikov <maxkalashnikov>
Thu 10 Sep 2009 03:53:14 AM UTC, comment #3: 

Ah ha.. so once again I regret the lack of a clever name for screen's internal commands. Perhaps that's a separate documentation/marketing bug itself, something cute/clever to call the rc/colon command "language?"

As for screen itself, I'll open a separate bug for that once a patch is forthcoming.

Fortunately, I think getopt is still the right answer, so the gnulib import effort benefits both areas.

Max Kalashnikov <maxkalashnikov>
Mon 07 Sep 2009 07:51:16 PM UTC, comment #2: 

Actually, this bug was intended for commands within screen, and not screen itself... though if you can do it for screen that's great, so long as it doesn't break backwards compatibility. But the screen commands have great redundancy in how they handle options, which means plenty of opportunity for nasty bugs.

Micah Cowan <micahcowan>
Mon 07 Sep 2009 07:35:24 PM UTC, comment #1: 

The gnu getopt (from gnulib if it's not on the host system, such as with BSD) seems like a good way to go, so I've started in on that.

The only tripping point so far are the -list and -ls options, which are "long" ones that conflict with the "short" -l. The current kludge looks fine, but perhaps deprecation in favor of --ls and --list would be good during a transition.

Max Kalashnikov <maxkalashnikov>
Tue 15 Jul 2008 06:17:32 PM UTC, original submission:  

The command-parsing for screen commands appears to involve quite a lot of redundant and potentially buggy code. Should use a standardized interface to find the options we're looking for, similar to getopt.

Micah Cowan <micahcowan>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by maxkalashnikov (Voted in favor of this item)
  • -email is unavailable- added by maxkalashnikov (Posted a comment)
  • -email is unavailable- added by micahcowan (Submitted the item)

    There are 35 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-09-07 maxkalashnikov Carbon-Copy- Added maxkalashnikov

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code