support cmdnorepo actions, also using getopt-applicative there
This commit is contained in:
		
					parent
					
						
							
								6e5c1f8db3
							
						
					
				
			
			
				commit
				
					
						92d8f80bff
					
				
			
		
					 10 changed files with 54 additions and 68 deletions
				
			
		| 
						 | 
				
			
			@ -11,7 +11,6 @@ import Common.Annex
 | 
			
		|||
import Types.Command
 | 
			
		||||
 | 
			
		||||
import System.Console.GetOpt
 | 
			
		||||
import qualified Options.Applicative as O
 | 
			
		||||
 | 
			
		||||
usageMessage :: String -> String
 | 
			
		||||
usageMessage s = "Usage: " ++ s
 | 
			
		||||
| 
						 | 
				
			
			@ -56,13 +55,6 @@ commandUsage cmd = unlines
 | 
			
		|||
		, "[option ...]"
 | 
			
		||||
		]
 | 
			
		||||
 | 
			
		||||
{- Simple CommandParser generator, for when the CommandSeek wants all
 | 
			
		||||
 - non-option parameters. -}
 | 
			
		||||
withParams :: (CmdParams -> CommandSeek) -> String -> CommandParser
 | 
			
		||||
withParams mkseek paramdesc = mkseek <$> O.many cmdparams
 | 
			
		||||
  where
 | 
			
		||||
	cmdparams = O.argument O.str (O.metavar paramdesc)
 | 
			
		||||
 | 
			
		||||
{- Descriptions of params used in usage messages. -}
 | 
			
		||||
paramPaths :: String
 | 
			
		||||
paramPaths = paramRepeating paramPath -- most often used
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue