Add a formatting script.
This commit is contained in:
		
							parent
							
								
									925a456de7
								
							
						
					
					
						commit
						cb8b0c93a1
					
				
					 1 changed files with 30 additions and 0 deletions
				
			
		
							
								
								
									
										30
									
								
								bin/format.awk
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										30
									
								
								bin/format.awk
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,30 @@
 | 
			
		|||
#!/usr/bin/awk -f
 | 
			
		||||
 | 
			
		||||
BEGIN {
 | 
			
		||||
	data = ""
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/^\[/ || /^\]/ {
 | 
			
		||||
	print "oups"
 | 
			
		||||
	next
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/^  {/ && /},$/ {
 | 
			
		||||
	print $0
 | 
			
		||||
	next
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/^  {/ {
 | 
			
		||||
	data = $0
 | 
			
		||||
	next
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/},$/ {
 | 
			
		||||
	data = sprintf("%s %s", data, $0)
 | 
			
		||||
	print data
 | 
			
		||||
	next
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
	data = sprintf("%s %s", data, $0)
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		
		Reference in a new issue