Don't indent JSON output
This commit is contained in:
		
							parent
							
								
									bac8055652
								
							
						
					
					
						commit
						c8155e9f5f
					
				
					 4 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -76,7 +76,7 @@ struct MixLs : virtual Args, MixJSON
 | 
				
			||||||
        if (path == "/") path = "";
 | 
					        if (path == "/") path = "";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (json) {
 | 
					        if (json) {
 | 
				
			||||||
            JSONPlaceholder jsonRoot(std::cout, true);
 | 
					            JSONPlaceholder jsonRoot(std::cout);
 | 
				
			||||||
            listNar(jsonRoot, accessor, path);
 | 
					            listNar(jsonRoot, accessor, path);
 | 
				
			||||||
        } else
 | 
					        } else
 | 
				
			||||||
            listText(accessor);
 | 
					            listText(accessor);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,7 +65,7 @@ struct CmdPathInfo : StorePathsCommand, MixJSON
 | 
				
			||||||
            pathLen = std::max(pathLen, storePath.size());
 | 
					            pathLen = std::max(pathLen, storePath.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (json) {
 | 
					        if (json) {
 | 
				
			||||||
            JSONPlaceholder jsonRoot(std::cout, true);
 | 
					            JSONPlaceholder jsonRoot(std::cout);
 | 
				
			||||||
            store->pathInfoToJSON(jsonRoot,
 | 
					            store->pathInfoToJSON(jsonRoot,
 | 
				
			||||||
                // FIXME: preserve order?
 | 
					                // FIXME: preserve order?
 | 
				
			||||||
                PathSet(storePaths.begin(), storePaths.end()),
 | 
					                PathSet(storePaths.begin(), storePaths.end()),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,7 +84,7 @@ struct CmdSearch : SourceExprCommand, MixJSON
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bool first = true;
 | 
					        bool first = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto jsonOut = json ? std::make_unique<JSONObject>(std::cout, true) : nullptr;
 | 
					        auto jsonOut = json ? std::make_unique<JSONObject>(std::cout) : nullptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto sToplevel = state->symbols.create("_toplevel");
 | 
					        auto sToplevel = state->symbols.create("_toplevel");
 | 
				
			||||||
        auto sRecurse = state->symbols.create("recurseForDerivations");
 | 
					        auto sRecurse = state->symbols.create("recurseForDerivations");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@ struct CmdShowConfig : Command, MixJSON
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (json) {
 | 
					        if (json) {
 | 
				
			||||||
            // FIXME: use appropriate JSON types (bool, ints, etc).
 | 
					            // FIXME: use appropriate JSON types (bool, ints, etc).
 | 
				
			||||||
            JSONObject jsonObj(std::cout, true);
 | 
					            JSONObject jsonObj(std::cout);
 | 
				
			||||||
            settings.toJSON(jsonObj);
 | 
					            settings.toJSON(jsonObj);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            for (auto & s : settings.getSettings())
 | 
					            for (auto & s : settings.getSettings())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue