Minor style fixes
This commit is contained in:
		
							parent
							
								
									61fd494d76
								
							
						
					
					
						commit
						dba33d4018
					
				
					 4 changed files with 14 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -16,7 +16,9 @@ using namespace nix;
 | 
			
		|||
// * use a database
 | 
			
		||||
// * show progress
 | 
			
		||||
 | 
			
		||||
static std::pair<FdSink, FdSource> connect(string conn) {
 | 
			
		||||
 | 
			
		||||
static std::pair<FdSink, FdSource> connect(const string & conn)
 | 
			
		||||
{
 | 
			
		||||
    Pipe to, from;
 | 
			
		||||
    to.create();
 | 
			
		||||
    from.create();
 | 
			
		||||
| 
						 | 
				
			
			@ -51,7 +53,9 @@ static std::pair<FdSink, FdSource> connect(string conn) {
 | 
			
		|||
    return std::pair<FdSink, FdSource>(to.writeSide.borrow(), from.readSide.borrow());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void substitute(std::pair<FdSink, FdSource> & pipes, Path storePath, Path destPath) {
 | 
			
		||||
 | 
			
		||||
static void substitute(std::pair<FdSink, FdSource> & pipes, Path storePath, Path destPath)
 | 
			
		||||
{
 | 
			
		||||
    writeInt(cmdSubstitute, pipes.first);
 | 
			
		||||
    writeString(storePath, pipes.first);
 | 
			
		||||
    pipes.first.flush();
 | 
			
		||||
| 
						 | 
				
			
			@ -59,7 +63,9 @@ static void substitute(std::pair<FdSink, FdSource> & pipes, Path storePath, Path
 | 
			
		|||
    std::cout << std::endl;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void query(std::pair<FdSink, FdSource> & pipes) {
 | 
			
		||||
 | 
			
		||||
static void query(std::pair<FdSink, FdSource> & pipes)
 | 
			
		||||
{
 | 
			
		||||
    writeInt(cmdQuery, pipes.first);
 | 
			
		||||
    for (string line; getline(std::cin, line);) {
 | 
			
		||||
        Strings tokenized = tokenizeString<Strings>(line);
 | 
			
		||||
| 
						 | 
				
			
			@ -92,6 +98,7 @@ static void query(std::pair<FdSink, FdSource> & pipes) {
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void run(Strings args)
 | 
			
		||||
{
 | 
			
		||||
    if (args.empty())
 | 
			
		||||
| 
						 | 
				
			
			@ -129,6 +136,7 @@ void run(Strings args)
 | 
			
		|||
        throw UsageError(format("download-via-ssh: unknown command `%1%'") % *i);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void printHelp()
 | 
			
		||||
{
 | 
			
		||||
    std::cerr << "Usage: download-via-ssh --query|--substitute store-path dest-path" << std::endl;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -215,7 +215,7 @@ string Settings::pack()
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void Settings::unpack(const string &pack) {
 | 
			
		||||
void Settings::unpack(const string & pack) {
 | 
			
		||||
    Strings lines = tokenizeString<Strings>(pack, "\n");
 | 
			
		||||
    foreach (Strings::iterator, i, lines) {
 | 
			
		||||
        string::size_type eq = i->find('=');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ struct Settings {
 | 
			
		|||
 | 
			
		||||
    string pack();
 | 
			
		||||
 | 
			
		||||
    void unpack(const string &pack);
 | 
			
		||||
    void unpack(const string & pack);
 | 
			
		||||
 | 
			
		||||
    SettingsMap getOverrides();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -835,7 +835,7 @@ static void opClearFailedPaths(Strings opFlags, Strings opArgs)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Serve the nix store in a way usable by a restricted ssh user
 | 
			
		||||
/* Serve the nix store in a way usable by a restricted ssh user. */
 | 
			
		||||
static void opServe(Strings opFlags, Strings opArgs)
 | 
			
		||||
{
 | 
			
		||||
    if (!opArgs.empty() || !opFlags.empty())
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue