Отображать в выводе списка снимков комментарий, пользователя, электронную почту
This commit is contained in:
		
							parent
							
								
									11eecbf128
								
							
						
					
					
						commit
						9835924def
					
				
					 1 changed files with 12 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -172,22 +172,31 @@ class Snag {
 | 
			
		|||
		writeln("Backup was created successfully: ", newSnapshot);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void list() {
 | 
			
		||||
	void list(bool comment, bool user, bool email) {
 | 
			
		||||
		string currentSnapshot = git(
 | 
			
		||||
			["rev-parse", "--short", "HEAD"],
 | 
			
		||||
			"Failed to retrieve current snapshot information"
 | 
			
		||||
		).output.strip('\n');
 | 
			
		||||
 | 
			
		||||
		string format = "format:%h\t%ad";
 | 
			
		||||
 | 
			
		||||
		comment && (format ~= "\t%s");
 | 
			
		||||
		user && (format ~= "\t%an");
 | 
			
		||||
		email && (format ~= "\t%ae");
 | 
			
		||||
 | 
			
		||||
		git(
 | 
			
		||||
			[
 | 
			
		||||
				"log",
 | 
			
		||||
				"--all",
 | 
			
		||||
				"--date=format:%Y.%m.%d %H:%M",
 | 
			
		||||
				"--pretty=format:%ad\t%h"
 | 
			
		||||
				"--pretty=" ~ format
 | 
			
		||||
			],
 | 
			
		||||
			"Failed to retrieve the list of snapshots"
 | 
			
		||||
		).output.split('\n').map!(line => line.split('\t')).array.each!(e =>
 | 
			
		||||
			writefln("%s\t%s\t%s", currentSnapshot == e[1] ? "    >" : "", e[0], e[1])
 | 
			
		||||
        	writefln("%s\t%s",
 | 
			
		||||
				currentSnapshot == e[0] ? "    >" : "",
 | 
			
		||||
				e.join("\t")
 | 
			
		||||
			)
 | 
			
		||||
		);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue