nix-env: Use wildcard match by default
That is, you don't need to pass '*' anymore, so nix-env -qa is equivalent to nix-env -qa '*'
This commit is contained in:
		
							parent
							
								
									07a08bddf0
								
							
						
					
					
						commit
						88c07341a6
					
				
					 2 changed files with 8 additions and 13 deletions
				
			
		| 
						 | 
					@ -95,8 +95,7 @@ int compareVersions(const string & v1, const string & v2)
 | 
				
			||||||
DrvNames drvNamesFromArgs(const Strings & opArgs)
 | 
					DrvNames drvNamesFromArgs(const Strings & opArgs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    DrvNames result;
 | 
					    DrvNames result;
 | 
				
			||||||
    for (Strings::const_iterator i = opArgs.begin();
 | 
					    foreach (Strings::const_iterator, i, opArgs)
 | 
				
			||||||
         i != opArgs.end(); ++i)
 | 
					 | 
				
			||||||
        result.push_back(DrvName(*i));
 | 
					        result.push_back(DrvName(*i));
 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -243,13 +243,13 @@ static DrvInfos filterBySelector(EvalState & state, const DrvInfos & allElems,
 | 
				
			||||||
    const Strings & args, bool newestOnly)
 | 
					    const Strings & args, bool newestOnly)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    DrvNames selectors = drvNamesFromArgs(args);
 | 
					    DrvNames selectors = drvNamesFromArgs(args);
 | 
				
			||||||
 | 
					    if (selectors.empty())
 | 
				
			||||||
 | 
					        selectors.push_back(DrvName("*"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DrvInfos elems;
 | 
					    DrvInfos elems;
 | 
				
			||||||
    set<unsigned int> done;
 | 
					    set<unsigned int> done;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (DrvNames::iterator i = selectors.begin();
 | 
					    foreach (DrvNames::iterator, i, selectors) {
 | 
				
			||||||
         i != selectors.end(); ++i)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        typedef list<std::pair<DrvInfo, unsigned int> > Matches;
 | 
					        typedef list<std::pair<DrvInfo, unsigned int> > Matches;
 | 
				
			||||||
        Matches matches;
 | 
					        Matches matches;
 | 
				
			||||||
        unsigned int n = 0;
 | 
					        unsigned int n = 0;
 | 
				
			||||||
| 
						 | 
					@ -321,8 +321,7 @@ static DrvInfos filterBySelector(EvalState & state, const DrvInfos & allElems,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Check that all selectors have been used. */
 | 
					    /* Check that all selectors have been used. */
 | 
				
			||||||
    for (DrvNames::iterator i = selectors.begin();
 | 
					    foreach (DrvNames::iterator, i, selectors)
 | 
				
			||||||
         i != selectors.end(); ++i)
 | 
					 | 
				
			||||||
        if (i->hits == 0 && i->fullName != "*")
 | 
					        if (i->hits == 0 && i->fullName != "*")
 | 
				
			||||||
            throw Error(format("selector `%1%' matches no derivations")
 | 
					            throw Error(format("selector `%1%' matches no derivations")
 | 
				
			||||||
                % i->fullName);
 | 
					                % i->fullName);
 | 
				
			||||||
| 
						 | 
					@ -913,9 +912,6 @@ static void opQuery(Globals & globals,
 | 
				
			||||||
        else remaining.push_back(arg);
 | 
					        else remaining.push_back(arg);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (remaining.size() == 0)
 | 
					 | 
				
			||||||
        printMsg(lvlInfo, "warning: you probably meant to specify the argument '*' to show all packages");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Obtain derivation information from the specified source. */
 | 
					    /* Obtain derivation information from the specified source. */
 | 
				
			||||||
    DrvInfos availElems, installedElems;
 | 
					    DrvInfos availElems, installedElems;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue