nix copy: make recursive by default
This commit is contained in:
		
							parent
							
								
									b8875213dc
								
							
						
					
					
						commit
						5421ad243e
					
				
					 3 changed files with 16 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -100,9 +100,21 @@ void StoreCommand::run()
 | 
			
		|||
    run(getStore());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
StorePathsCommand::StorePathsCommand()
 | 
			
		||||
StorePathsCommand::StorePathsCommand(bool recursive)
 | 
			
		||||
    : recursive(recursive)
 | 
			
		||||
{
 | 
			
		||||
    mkFlag('r', "recursive", "apply operation to closure of the specified paths", &recursive);
 | 
			
		||||
    if (recursive)
 | 
			
		||||
        mkFlag()
 | 
			
		||||
            .longName("no-recursive")
 | 
			
		||||
            .description("apply operation to specified paths only")
 | 
			
		||||
            .set(&this->recursive, false);
 | 
			
		||||
    else
 | 
			
		||||
        mkFlag()
 | 
			
		||||
            .longName("recursive")
 | 
			
		||||
            .shortName('r')
 | 
			
		||||
            .description("apply operation to closure of the specified paths")
 | 
			
		||||
            .set(&this->recursive, true);
 | 
			
		||||
 | 
			
		||||
    mkFlag(0, "all", "apply operation to the entire store", &all);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -141,7 +141,7 @@ private:
 | 
			
		|||
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
    StorePathsCommand();
 | 
			
		||||
    StorePathsCommand(bool recursive = false);
 | 
			
		||||
 | 
			
		||||
    using StoreCommand::run;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,6 +17,7 @@ struct CmdCopy : StorePathsCommand
 | 
			
		|||
    SubstituteFlag substitute = NoSubstitute;
 | 
			
		||||
 | 
			
		||||
    CmdCopy()
 | 
			
		||||
        : StorePathsCommand(true)
 | 
			
		||||
    {
 | 
			
		||||
        mkFlag(0, "from", "store-uri", "URI of the source Nix store", &srcUri);
 | 
			
		||||
        mkFlag(0, "to", "store-uri", "URI of the destination Nix store", &dstUri);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue