module HashAddressed.App.Command.Examples.Main
  (
    mainCommand,
  )
  where

import Essentials
import HashAddressed.App.Command.Examples.Initialize
import HashAddressed.App.Command.Examples.Version
import HashAddressed.App.Command.Examples.Write
import HashAddressed.App.Command.Type

import qualified Options.Applicative as Options

mainCommand :: Command
mainCommand :: Command
mainCommand = forall a. Parser a -> InfoMod a -> ParserInfo a
Options.info (Parser (CommandAction ())
parser forall (f :: * -> *) a b. Applicative f => f a -> f (a -> b) -> f b
<**> forall a. Parser (a -> a)
Options.helper) forall a b. (a -> b) -> a -> b
$
    forall a. String -> InfoMod a
Options.progDesc String
"Hash-addressed file storage"
  where
    parser :: Options.Parser (CommandAction ())
    parser :: Parser (CommandAction ())
parser = forall a. Mod CommandFields a -> Parser a
Options.subparser forall a b. (a -> b) -> a -> b
$
        forall a. String -> ParserInfo a -> Mod CommandFields a
Options.command String
"version" Command
versionCommand forall a. Semigroup a => a -> a -> a
<>
        forall a. String -> ParserInfo a -> Mod CommandFields a
Options.command String
"initialize" Command
initializeCommand forall a. Semigroup a => a -> a -> a
<>
        forall a. String -> ParserInfo a -> Mod CommandFields a
Options.command String
"write" Command
writeCommand