Add editing options
[ci skip]
This commit is contained in:
		
							
								
								
									
										20
									
								
								manage
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								manage
									
									
									
									
									
								
							@@ -7,14 +7,16 @@ usage() {
 | 
			
		||||
Usage: $0 <command> [options]
 | 
			
		||||
 | 
			
		||||
Commands:
 | 
			
		||||
  help         Show this help message and exit
 | 
			
		||||
  new [name]   Create a new song [with the specified name]
 | 
			
		||||
  edit <name>  Edit song with $EDITOR (taken from the EDITOR env var)
 | 
			
		||||
  help          Show this help message and exit
 | 
			
		||||
  new [name]    Create a new song [with the specified name]
 | 
			
		||||
  edit <name>   Edit song with a text editor
 | 
			
		||||
  iedit <name>  Interactive edit with PDF preview
 | 
			
		||||
 | 
			
		||||
Examples:
 | 
			
		||||
  $0 help
 | 
			
		||||
  $0 new [song-name]
 | 
			
		||||
  $0 edit <song-name>
 | 
			
		||||
  $0 iedit <song-name>
 | 
			
		||||
 | 
			
		||||
EOF
 | 
			
		||||
  exit 1
 | 
			
		||||
@@ -47,7 +49,17 @@ case "$1" in
 | 
			
		||||
		;;
 | 
			
		||||
	edit)
 | 
			
		||||
		if [ "$#" -eq 2 ]; then
 | 
			
		||||
			$EDITOR "content/$2/$2.cho"
 | 
			
		||||
			xdg-open "content/$2/$2.cho"
 | 
			
		||||
		else
 | 
			
		||||
			echo -e "Missing song name\n"
 | 
			
		||||
			usage
 | 
			
		||||
		fi
 | 
			
		||||
		;;
 | 
			
		||||
	iedit)
 | 
			
		||||
		if [ "$#" -eq 2 ]; then
 | 
			
		||||
			touch "content/$2/$2.pdf"
 | 
			
		||||
			xdg-open "content/$2/$2.pdf" &
 | 
			
		||||
			xdg-open "content/$2/$2.cho"
 | 
			
		||||
		else
 | 
			
		||||
			echo -e "Missing song name\n"
 | 
			
		||||
			usage
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user