Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 2365

Summary: Standardise Portage (emerge) CLI options
Product: Portage Development Reporter: Troy Dack <troy>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: agenkin, alexander.winston, andre.hinrichs, ciaran.mccreesh, doug, drobbins, gentoo, graeme, gullevek, matze, mholzer, SKhanna21, slide, tester, tolasliam, vhata-gentoo
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: x86   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 9235    
Attachments: Patch for emerge itself.
Patch for emergehelp.py.

Description Troy Dack 2002-05-02 19:02:53 UTC
Emerge has been through a number of revisions, with many of these altering the 
options that it accepts on the command line.

I suggest that command line options be standardised to something along these 
lines:

Unless the extra arguments are a package they should be preceeded by either two 
minus signs (ie: --) for long options or one minus sign (ie: -) for short 
options, eg:

--search, -s
--rsync, -r
--clean, -c

For options where a specific target exists then make the option something like:
--update=world
--update=system

This way there is no confusion when you try and emerge a package, for example 
trying to actually emerge the rsync package requires that the category and 
package is specified, rather than just: emerge rsync :)
Comment 1 SpanKY gentoo-dev 2002-10-20 11:51:17 UTC
*** Bug 6785 has been marked as a duplicate of this bug. ***
Comment 2 SpanKY gentoo-dev 2003-02-25 20:06:07 UTC
second glance
Comment 3 Arcady Genkin (RETIRED) gentoo-dev 2003-02-26 21:07:48 UTC
I like the idea very much.
Comment 4 SpanKY gentoo-dev 2003-02-28 16:18:49 UTC
*** Bug 16556 has been marked as a duplicate of this bug. ***
Comment 5 Jonathan Hitchcock 2003-03-02 08:40:24 UTC
I wanted to suggest something along the lines of "emerge world -package", for when you want to emerge everything except one particular package.  It's a mission to type out all the package names when you know that something is going to break, or you don't want to upgrade something, so you can't just use "world".

However, with this new idea (which I quite like), maybe it could be "--exclude=package1,package2", or something?
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2003-03-05 10:16:16 UTC
*** Bug 16894 has been marked as a duplicate of this bug. ***
Comment 7 Martin Holzer (RETIRED) gentoo-dev 2003-03-14 08:43:25 UTC
*** Bug 17505 has been marked as a duplicate of this bug. ***
Comment 8 Jonathan Hitchcock 2003-04-27 07:05:50 UTC
And, of course, we also need a -violent option:
http://bash.org/?50000
Comment 9 SpanKY gentoo-dev 2003-08-27 17:15:21 UTC
*** Bug 27264 has been marked as a duplicate of this bug. ***
Comment 10 Alexander Winston 2003-08-27 20:39:39 UTC
Yeah, I had a large portion of the long options standardized and patches
submitted, but it seems 
Comment 11 Alexander Winston 2003-08-27 20:39:39 UTC
Yeah, I had a large portion of the long options standardized and patches
submitted, but it seems SpanKY forgot to move the files over. Also, why are
bugs with patches attached being marked as duplicates to bugs that were once
dead and have never had any patches?
Comment 12 SpanKY gentoo-dev 2003-08-27 20:57:46 UTC
rather than cluttering bug reports take these issues to the wranglers 
Comment 13 Alexander Winston 2003-08-29 22:18:33 UTC
Created attachment 16797 [details, diff]
Patch for emerge itself.
Comment 14 Alexander Winston 2003-08-29 22:20:24 UTC
Created attachment 16798 [details, diff]
Patch for emergehelp.py.

Note that emergehelp.py should probably be merged with emerge.
Comment 15 SpanKY gentoo-dev 2003-09-12 05:40:43 UTC
*** Bug 28498 has been marked as a duplicate of this bug. ***
Comment 16 Marius Mauch (RETIRED) gentoo-dev 2003-09-21 06:20:34 UTC
actually all actions (like sync, info, ...) already are long options, but the deprecation notice is commented. Nick, is this just convenience or are there other reasons ?
Comment 17 SpanKY gentoo-dev 2003-09-21 09:12:24 UTC
when we originally started deprecating options drobbins was unaware since he was
working on other projects at the time.  he felt like the change was made without
checking with 'appropriate' people and thus told nick to remove the notice.
Comment 18 SpanKY gentoo-dev 2003-10-23 22:02:33 UTC
*** Bug 31864 has been marked as a duplicate of this bug. ***
Comment 19 Donnie Berkholz (RETIRED) gentoo-dev 2003-12-03 20:01:17 UTC
*** Bug 35025 has been marked as a duplicate of this bug. ***
Comment 20 Marius Mauch (RETIRED) gentoo-dev 2003-12-04 05:35:23 UTC
*** Bug 35035 has been marked as a duplicate of this bug. ***
Comment 21 Andre Hinrichs 2003-12-04 05:57:39 UTC
The problem occured again with the newly update to the rsync package.
Since I have basically a unmasked installation but currently one package (xerces) wich I need in masked version I ran into the this. I tried to emerge the rsync package not knowing that this was (is) a keyword for emerge (since it is neither listed in the man page nor in help). I looked into the sources of emerge and saw a message like "--rsync has been deprecated. Please use '--sync' instead." But this message was not printed on my screen... emerge simply did a sync.
I'd like to suggest an additional action for emerge instead e.g. "emerge install package(s)". Then it would also be clear that an install can be done with multiple packages and packages after an 'install' action may have (special) names like 'unmerge' or 'sync' or 'rsync'...
Comment 22 SpanKY gentoo-dev 2003-12-06 19:58:41 UTC
*** Bug 35218 has been marked as a duplicate of this bug. ***
Comment 23 roma1390 2003-12-09 10:52:42 UTC
i vote for --sync and for shot version -s like in all GNU tools. 
Comment 24 Marius Mauch (RETIRED) gentoo-dev 2004-01-04 13:27:46 UTC
*** Bug 37224 has been marked as a duplicate of this bug. ***
Comment 25 SpanKY gentoo-dev 2004-01-05 10:08:43 UTC
*** Bug 37301 has been marked as a duplicate of this bug. ***
Comment 26 Marius Mauch (RETIRED) gentoo-dev 2004-01-12 03:59:49 UTC
*** Bug 37951 has been marked as a duplicate of this bug. ***
Comment 27 Marius Mauch (RETIRED) gentoo-dev 2004-01-12 04:00:25 UTC
*** Bug 37950 has been marked as a duplicate of this bug. ***
Comment 28 SpanKY gentoo-dev 2004-02-04 22:04:56 UTC
*** Bug 40440 has been marked as a duplicate of this bug. ***
Comment 29 rob holland (RETIRED) gentoo-dev 2004-08-19 15:33:20 UTC
does anyone still object to this? I'd really like emerge rsync to emerge rsync.
Comment 30 Michael Wardle 2004-09-14 15:32:08 UTC
This even happens if rsync is not the first parameter (such as emerge less rsync),  despite the emerge(1) manual page showing that the action must appear as the first non-option parameter.

The two ways this could be fixed:
1) Add the "install" or "merge" action, make an action mandatory, and fix emerge so that only the first non-option parameter is interpreted as the action.
2) Convert the actions to options (prefix them all with a double hyphen), make any bare word parameter to emerge be interpreted as a package name.

The first option seems to be a better design to me.  It is also how Debian's apt-get works.

In any case, removing the rsync alias for sync is a minimal change that would stop so many people being bitten by "emerge rsync" doing the wrong thing.

The fact this bug has been open for over two years is extremely irritating.
Comment 31 Jason Stubbs (RETIRED) gentoo-dev 2004-10-05 05:53:19 UTC
emerge rsync prints warning notice (without beeps! ;) and does emerge rsync
emerge --rsync prints deprecation notice and does emerge --sync
Comment 32 Nicholas Jones (RETIRED) gentoo-dev 2004-10-22 08:48:10 UTC
Bug has been fixed and released in stable portages on or before 2.0.51-r2