[enh] There should be a command plugin
This commit is contained in:
		
							parent
							
								
									a5cf3456c6
								
							
						
					
					
						commit
						68bd4f90d3
					
				
							
								
								
									
										11
									
								
								plugins-available/content-command.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								plugins-available/content-command.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| #!/bin/bash | ||||
| # Add a content line by decorating the input with triple backticks ``` | ||||
| PLUGIN_CONTENT+=( hookContentCmd ) | ||||
| hookContentCmd(){ | ||||
|   [[ -z "$1" ]] && echo "Add a shell command line" && return | ||||
|   TMP="$1" | ||||
|   read -e -p "Command line? " CMD | ||||
|   [[ -z "$CMD" ]] && panic "Not a valid content" && return | ||||
|   echo "\`\`\`$CMD\`\`\`" >> $TMP | ||||
| } | ||||
| 
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user