updated help message format
This commit is contained in:
		
							parent
							
								
									06c068d9b6
								
							
						
					
					
						commit
						15b8f5c4e1
					
				
							
								
								
									
										137
									
								
								src/messages.rkt
									
									
									
									
									
								
							
							
						
						
									
										137
									
								
								src/messages.rkt
									
									
									
									
									
								
							| @ -7,123 +7,82 @@ | |||||||
| (define (indent string) | (define (indent string) | ||||||
|   (string-append "\t" string)) |   (string-append "\t" string)) | ||||||
| 
 | 
 | ||||||
| (define line-gap-single "\n") | (define newline "\n") | ||||||
| (define line-gap-double "\n\n") | (define newline-double "\n\n") | ||||||
| (define space " ") |  | ||||||
| (define tab "\t") |  | ||||||
| (define tab-double "\t\t") |  | ||||||
| 
 | 
 | ||||||
| (define messages | (define messages | ||||||
|   (hash |   (hash 'show-help (string-append | ||||||
|     'show-help |                      "NAME" newline | ||||||
|     (string-append "rodo" |                      "====" newline | ||||||
|                    line-gap-double |                      "rodo" newline-double | ||||||
| 
 | 
 | ||||||
|                    "NAME" |                      "DESCRIPTION" newline | ||||||
|                    line-gap-single |                      "===========" newline | ||||||
|                    tab "rodo - A list-management tool" |                      "rodo is a minimalistic list-management tool. It does not use any data formats, and cannot remove multiple items at once." newline-double | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    "SYNOPSIS" |                      "USAGE SYNTAX" newline | ||||||
|                    line-gap-single |                      "============" newline | ||||||
|                    tab "rodo [command] <args>" |                      "rodo [command] <args>" newline-double | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    "DESCRIPTION" |                      "COMMANDS AVAILABLE" newline | ||||||
|                    line-gap-single |                      "==================" newline | ||||||
|                    tab "rodo is a minimalistic list-management tool. It does not use any data formats, and cannot remove multiple items at once." |                      (car config:initialize-commands) " - " (format "Creates a list file located at ~a" config:list-file) newline-double | ||||||
|                    line-gap-double |  | ||||||
|                    tab (format "I made this tool to separate my hobby todos and my important todos. I do this by only using ~a to organize my hobby todos on the command line, and my important todos on a synced calendar elsewhere." config:program-name) |  | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    "COMMANDS" |                      (car config:list-commands) " - " "Displays items from your list" newline-double | ||||||
|                    line-gap-single |  | ||||||
|                    ;; initialize-command |  | ||||||
|                    tab (car config:initialize-commands) |  | ||||||
|                    line-gap-single |  | ||||||
|                    tab-double (format "Creates a list file located at ~a" config:list-file) |  | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    ;; list-command |                      (car config:add-commands) " <args> - Adds an item to your list" newline-double | ||||||
|                    tab (car config:list-commands) |  | ||||||
|                    line-gap-single |  | ||||||
|                    tab-double "Displays items from your list" |  | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    ;; add-command |                      (car config:remove-commands) " <args> - Removes an item from your list" newline-double | ||||||
|                    tab (car config:add-commands) space "<args>" |  | ||||||
|                    line-gap-single |  | ||||||
|                    tab-double "Adds an item to your list" |  | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    ;; remove-command |                      "USAGE EXAMPLES" newline | ||||||
|                    tab (car config:remove-commands) space "<args>" |                      "==============" newline | ||||||
|                    line-gap-single |                      (car config:initialize-commands) " usage:" newline | ||||||
|                    tab-double"Removes an item from your list" |                      (format "~a ~a" config:program-name (car config:initialize-commands)) newline-double | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    "USAGE EXAMPLES" |                      (car config:list-commands) " usage:" newline | ||||||
|                    line-gap-single |                      (format "~a ~a" config:program-name (car config:list-commands)) newline-double | ||||||
|                    ;; initialize-command |  | ||||||
|                    tab (car config:initialize-commands) |  | ||||||
|                    line-gap-single |  | ||||||
|                    tab-double (format "~a ~a" config:program-name (car config:initialize-commands)) |  | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    ;; list-command |                      (car config:add-commands) " usage:" newline | ||||||
|                    tab (car config:list-commands) |                      (format "~a ~a this is an item without double quotation marks" config:program-name (car config:add-commands)) newline | ||||||
|                    line-gap-single |                      (format "~a ~a \"this is an item surrounded by double quotation marks\"" config:program-name (car config:add-commands)) newline-double | ||||||
|                    tab-double (format "~a ~a" config:program-name (car config:list-commands)) |  | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    ;; add-command |                      (car config:remove-commands) " usage:" newline | ||||||
|                    tab (car config:add-commands) |                      (format "~a ~a 2" config:program-name (car config:remove-commands)) newline-double | ||||||
|                    line-gap-single |  | ||||||
|                    tab-double (format "~a ~a this is an item without double quotation marks" config:program-name (car config:add-commands)) |  | ||||||
|                    line-gap-single |  | ||||||
|                    tab-double (format "~a ~a \"this is an item surrounded by double quotation marks\"" config:program-name (car config:add-commands)) |  | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    ;; remove-command |                      "Can't see the whole help message?" newline | ||||||
|                    tab (car config:remove-commands) |                      "=================================" newline | ||||||
|                    line-gap-single |                      "Try running the command below:" newline | ||||||
|                    tab-double (format "~a ~a 2" config:program-name (car config:remove-commands)) |                      (format "~a ~a | less" config:program-name (car config:help-commands)) newline) | ||||||
|                    line-gap-double |  | ||||||
| 
 | 
 | ||||||
|                    "Can't see the whole help message? Try running:" |         'empty-list "> There is nothing in your list\n" | ||||||
|                    line-gap-single |  | ||||||
|                    (format "~a ~a | less" config:program-name (car config:help-commands)) |  | ||||||
|                    line-gap-single) |  | ||||||
| 
 | 
 | ||||||
|     'empty-list "> There is nothing in your list\n" |         'show-usage (format "> For usage type ~a -h\n" config:program-name) | ||||||
| 
 | 
 | ||||||
|     'show-usage (format "> For usage type ~a -h\n" config:program-name) |         'creating (format "> Creating a list in ~a...\n" config:list-file) | ||||||
| 
 | 
 | ||||||
|     'creating (format "> Creating a list in ~a...\n" config:list-file) |         'creation-error (format "> Error: Could not create a list file in ~a\n" config:list-file) | ||||||
| 
 | 
 | ||||||
|     'creation-error (format "> Error: Could not create a list file in ~a\n" config:list-file) |         'file-already-exists (format "> Error: A list file already exists in ~a\n" config:list-file) | ||||||
| 
 | 
 | ||||||
|     'file-already-exists (format "> Error: A list file already exists in ~a\n" config:list-file) |         'successfully-created (format "> Your list file was successfully created in ~a\n" config:list-file) | ||||||
| 
 | 
 | ||||||
|     'successfully-created (format "> Your list file was successfully created in ~a\n" config:list-file) |         'file-not-found (format "> Error: Could not find ~a\n" config:list-file) | ||||||
| 
 | 
 | ||||||
|     'file-not-found (format "> Error: Could not find ~a\n" config:list-file) |         'item-not-found "> Error: Could not find that item\n" | ||||||
| 
 | 
 | ||||||
|     'item-not-found "> Error: Could not find that item\n" |         'init-y/n (format "> A list file will be created in ~a\n> Are you sure you want to continue? [y/n]\n" config:list-file) | ||||||
| 
 | 
 | ||||||
|     'init-y/n (format "> A list file will be created in ~a\n> Are you sure you want to continue? [y/n]\n" config:list-file) |         'try-init (format "> Try typing ~a ~a to set it up\n" config:program-name (car config:initialize-commands)) | ||||||
| 
 | 
 | ||||||
|     'try-init (format "> Try typing ~a ~a to set it up\n" config:program-name (car config:initialize-commands)) |         'terminating (format "> Exited ~a\n" config:program-name) | ||||||
| 
 | 
 | ||||||
|     'terminating (format "> Exited ~a\n" config:program-name) |         'choose-y/n "> Error: Please choose y or n\n" | ||||||
| 
 | 
 | ||||||
|     'choose-y/n "> Error: Please choose y or n\n" |         'not-in-list "> Error: Item does not exist\n" | ||||||
| 
 | 
 | ||||||
|     'not-in-list "> Error: Item does not exist\n" |         'item-added "> Added \"~a\" to your list\n" | ||||||
| 
 | 
 | ||||||
|     'item-added "> Added \"~a\" to your list\n" |         'item-removed "> Removed \"~a\" from your list\n")) | ||||||
| 
 |  | ||||||
|     'item-removed "> Removed \"~a\" from your list\n")) |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| (define y/n (hash 'yes '("yes" "Yes" "y" "Y") | (define y/n (hash 'yes '("yes" "Yes" "y" "Y") | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user