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


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

Submitted by:  Micah Cowan <micahcowan>
Submitted on:  Tue Jul 15 18:17:32 2008  
Votes:  35  
Category: Code ArchitectureSeverity: 3 - Normal
Priority: 5 - NormalStatus: Confirmed
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: None
Fixed Release: NonePlanned Release: Later
Work Required: 0 - Hours

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sat Sep 12 20:36:46 2009, 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 Sep 10 03:53:14 2009, 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 Sep 7 19:51:16 2009, 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>
Project Member
Mon Sep 7 19:35:24 2009, 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 Jul 15 18:17:32 2008, 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>
Project Member


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 35 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Sep 7 23:14:59 2009maxkalashnikovCarbon-Copy-=>Added maxkalashnikov

    Back to the top

    Powered by Savane 3.1-cleanup1